Program Untuk Mengubah Bilangan bulat Menjadi Bilangan romawi menggunakan QB

‘ NOVITA DWI WULANDARI

CLS
DIM MA AS INTEGER

INPUT “MASUKAN ANGKA = “, MA

PRINT

DO WHILE MA >= 1000
PRINT “M”;
MA = MA – 1000
LOOP

DO WHILE MA >= 500
IF MA >= 900 THEN
PRINT “CM”;
MA = MA – 900
ELSE
PRINT “D”;
MA = MA – 500
END IF
LOOP

DO WHILE MA >= 100
IF MA >= 400 THEN
PRINT “CD”;
MA = MA – 400
ELSE
PRINT “C”;
MA = MA – 100
END IF
LOOP

DO WHILE MA >= 50
IF MA >= 90 THEN
PRINT “XC”;
MA = MA – 90
ELSE
PRINT “L”;
MA = MA – 50
END IF
LOOP

DO WHILE MA >= 10
IF MA >= 40 THEN
PRINT “XL”;
MA = MA – 40
ELSE
PRINT “X”;
MA = MA – 10
END IF
LOOP

DO WHILE MA >= 5
IF MA = 9 THEN
PRINT “IX”;
MA = MA – 9
ELSE
PRINT “V”;
MA = MA – 5
END IF
LOOP

DO WHILE MA >= 1
IF MA = 4 THEN
PRINT “IV”;
MA = MA – 4
ELSE
PRINT “I”;
MA = MA – 1
END IF
LOOP

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s