Difference between revisions of "Talk:Muhammad Rais Habibie"
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...") |
Mraishabibie (talk | contribs) |
||
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 | + | 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 | ||
− | + | i2 = b2 - q2 | |
− | + | j2 = c2 - r2 | |
− | + | y = j2 / i2 | |
− | + | x = (c - (b * y))/a | |
− | + | 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: | ||
− | + | x = c/a | |
− | + | 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 : | ||
− | + | x = r/p | |
− | + | 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()