konversi desimal to romawi

June 24, 2008 at 5:43 am | Posted in Informatic | 5 Comments

sekedar berbagi, berikut salah satu program untuk mengkonversi desimal to romawi :

Program Romawi;

Uses WinCrt;

Const

Des : array [1..13] of integer =

(1000,900,500,400,100,90,50,40,10,9,5,4,1);

Rom : array [1..13] of String =

(‘M’,’CM’,’D’,’CD’,’C’,’XC’,’L’,’XL’,’X’,’IX’,’V’,’IV’,’I’);

Var

Bil,i,Bil1 : Integer;

Roma : String;

Begin

writeln (‘**************************************************’);

writeln (‘ PROGRAM KONVERSI BILANGAN DESIMAL KE ROMAWI ‘);

writeln (‘**************************************************’);

Write(‘Masukkan bilangan yang akan dikonversi [1..4999] : ‘);

Readln(Bil);

Bil1 := Bil;

if (Bil > 0) and (Bil <= 4999) then

Begin

For i:=1 to 13 do

Begin

while (Bil >= Des[i]) do

Begin

Bil := Bil – Des[i];

Roma := Roma + Rom[i]

End;

End;

Write(‘Angka ‘,Bil1,’ –> Romawinya ‘,Roma)

end

else

Writeln(‘Tidak Diketahui Simbol Romawinya…..’);

End.


5 Comments »

RSS feed for comments on this post. TrackBack URI

  1. boleh minta konversi desimal ke romawi yang pake java ga (JCreator) plissss , stress bgt ni ngerjain tugas ini…..

  2. muuph..gak ada jee..

  3. wuih..
    patut dicoba

    //komen dulu baru dipelajari hehehe…

  4. konversi desimal ke romawinya ada ga yang pake bahasa C.
    Kalau ada kirim dong ke email saya
    di

    pliss

  5. thank;z nya cmoga bermanfaat bagi aq……….hehehe


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: