Sabtu, 12 November 2011

Contoh Program Matriks

CLS
COLOR 14
DIM b, k AS INTEGER
PRINT TAB(2); "----------------------------------"
PRINT TAB(2); "Program Matriks"
PRINT TAB(2); "----------------------------------"
PRINT
LOCATE , 2
INPUT "Masukan jumlah baris : ", b
LOCATE , 2
INPUT "Masukan jumlah kolom : ", k
FOR n = 1 TO b
FOR m = 1 TO k
PRINT
LOCATE , 2
PRINT "Posisi ("; n; m; ")"
LOCATE , 2
INPUT "Masukan angka : ", a(n, m)
PRINT
NEXT m
NEXT n
CLS
PRINT "---------------------------------"
PRINT "Hasil Matriks"
PRINT "---------------------------------"
PRINT
PRINT
FOR n = 1 TO b
FOR m = 1 TO k
PRINT a(n, m),
NEXT m
PRINT
PRINT
NEXT n
END


OUTPUT :
 

0 komentar:

Posting Komentar

 
;