Older Version
Newer Version
harmonv
Oct 1, 2006
This little program will convert numbers to Roman Numerals. It is able to convert any value from 1 to 3999. Romans did not have a consistent numbering scheme after 3999. [[code format="qbasic"]] dim i(13) dim r$(13) key$ = "1000 M 900 CM 500 D 400 CD 100 C 90 XC 50 L 40 XL 10 X 9 IX 5 V 4 IV 1 I" [again] roman$ = "" input "Please enter a number:";num if num < 4000 thenforfor x = 0 to 12i(x+1)i(x+1) = val(word$(key$,(x*2)+1))r$(x+1)r$(x+1) = word$(key$,(x*2)+2)whilewhile num >= i(x+1)roman$roman$ = roman$ + r$(x+1)numnum = num - i(x+1)wend nextwend next x