Talk:Muhammad Rais Habibie

From ccitonlinewiki
Revision as of 23:28, 18 February 2019 by Mraishabibie (talk | contribs) (Created page with " print ('Persamaan linear dua variabel \n ax + by = c\n px + qy = r ') a = float(input(" masukan nilai a =")) b = float(input(" masukan nilai b =")) c = float(input(" masu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

print ('Persamaan linear dua variabel \n ax + by = c\n px + qy = r ')

a = float(input(" masukan nilai a =")) b = float(input(" masukan nilai b =")) c = float(input(" masukan nilai c =")) p = float(input(" masukan nilai p =")) q = float(input(" masukan nilai q =")) r = float(input(" masukan nilai r ="))


if a == p :

   i = b - q
   j = c - r
   y = j/i
   x = c /(b*y)
   print("nilai y=",y,"nilai x =",x)

elif a != p :

       a2= a*p
       b2=b*p
       c2=c*p
       p2=p*a
       q2=q*a
       r2=r*a
       if a2 == p2 :
           i2 = b2 - q2
           j2 = c2 - r2
           y = j2 / i2
           x = c / (b * y)
           print("nilai y=", y, "nilai x =", x)

elif a == 0 :

   y = c/b
   x = (r-(q*y))/p
   print("nilai y=", y, "nilai x =", x)

elif b == 0:

   y = c/a
   x = (r - (q * y)) / p
   print("nilai y=", y, "nilai x =", x)

elif p == 0 :

   y = r/q
   x = (c - (a*y) )/b
   print("nilai y=", y, "nilai x =", x)

elif q == 0 :

   y = r/p
   x = (c - (a * y)) / b
   print("nilai y=", y, "nilai x =", x)