Difference between revisions of "Talk:Muhammad Rais Habibie"

From ccitonlinewiki
Jump to: navigation, search
(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...")
 
 
Line 1: Line 1:
 +
 +
  
 
print ('Persamaan linear dua variabel \n  ax + by = c\n  px + qy = r ')
 
print ('Persamaan linear dua variabel \n  ax + by = c\n  px + qy = r ')
Line 15: Line 17:
 
     j = c - r
 
     j = c - r
 
     y = j/i
 
     y = j/i
     x = c /(b*y)
+
     x = (c -(b*y))/a
 
     print("nilai y=",y,"nilai x =",x)
 
     print("nilai y=",y,"nilai x =",x)
  
Line 25: Line 27:
 
         q2=q*a
 
         q2=q*a
 
         r2=r*a
 
         r2=r*a
         if a2 == p2 :
+
         i2 = b2 - q2
            i2 = b2 - q2
+
        j2 = c2 - r2
            j2 = c2 - r2
+
        y = j2 / i2
            y = j2 / i2
+
        x = (c - (b * y))/a
            x = c / (b * y)
+
        print("nilai y=", y, "nilai x =", x)
            print("nilai y=", y, "nilai x =", x)
 
 
elif a == 0 :
 
elif a == 0 :
 
     y = c/b
 
     y = c/b
     x = (r-(q*y))/p
+
     x = (r - (q*y))/p
 
     print("nilai y=", y, "nilai x =", x)
 
     print("nilai y=", y, "nilai x =", x)
 
elif b == 0:
 
elif b == 0:
     y = c/a
+
     x = c/a
     x = (r - (q * y)) / p
+
     y = (r - (p * x )) / q
 
     print("nilai y=", y, "nilai x =", x)
 
     print("nilai y=", y, "nilai x =", x)
 
elif p == 0 :
 
elif p == 0 :
Line 44: Line 45:
 
     print("nilai y=", y, "nilai x =", x)
 
     print("nilai y=", y, "nilai x =", x)
 
elif q == 0 :
 
elif q == 0 :
     y = r/p
+
     x = r/p
     x = (c - (a * y)) / b
+
     y = (c - (a * x)) / b
 
     print("nilai y=", y, "nilai x =", x)
 
     print("nilai y=", y, "nilai x =", x)
 +
 +
 +
 +
 +
input()

Latest revision as of 16:48, 19 February 2019


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))/a
   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
       i2 = b2 - q2
       j2 = c2 - r2
       y = j2 / i2
       x = (c - (b * y))/a
       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:

   x = c/a
   y = (r - (p * x )) / q
   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 :

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



input()