Page 18 - Pengenalan Bahasa Basic
P. 18
c. 10 READ A d. 10 DATA 7, 8
20 DATA 7, 8, 15 20 READ A, B
30 READ B, C 30 LET A = B
40 LET D = A + B + C 40 PRINT “A SAMA DENGAN “; A
50 PRINT “D SAMA DENGAN “; D 50 PRINT ”B SAMA DENGAN ”; B
60 END 60 END
e. 10 DATA 4, 6 f. 10 DATA 3, 4
20 READ A, B 20 READ F, G
30 PRINT “A + B = “; A + B 30 PRINT “F x G = “; F * G
40 END 40 END
g. 10 DATA 5, 7 h. 10 DATA 5
20 READ P, Q 20 READ C
30 LET P = Q 30 LET R = 0.8 * C
40 LET R = P * Q 40 PRINT C; “CELCIUS SAMA DENGAN “; R; “ REAMUR”
50 PRINT “R = “; P * Q 50 END
60 END
i. 10 LET D = 0 j. 10 DATA 2, 5
20 LET D = D + 1 20 READ A, B
30 LET D = D + 2 30 LET A = A * B
40 LET D = D + 3 40 LET B = A
50 LET D = D + 4 50 LET A = A + 2
60 PRINT D 60 PRINT A + 5
70 END 70 END
k. 10 DATA 4, 6
20 READ A, B
30 LET C = A * B * 5
40 LET B = C
50 PRINT “B = “; B
60 PRINT “A + B = “; A * B
70 PRINT “B + C = “; B + C
80 PRINT “B – A = “; B – A
90 END
Program Turbo Basic 15 Edi Supriyanto, S. Pd.