next up previous contents
Next: Solution Up: Control StructureIntrinsics and Previous: Solution

 

Decimal to Roman Numerals Conversion

Using a SELECT CASE block and integer divison write a program that reads in a decimal number between 0 and 999 and prints out the equivalent in Roman Numerals.

Demonstrate that your program works with the numbers:

  1. 888
  2. 0
  3. 222
  4. 536

The output should contain no embedded spaces.

tabular1343

Hint: Use a CHARACTER string (or CHARACTER strings) to store the number before output. The `longest' number is 888, dccclxxxviii (12 characters).




next up previous contents
Next: Solution Up: Control StructureIntrinsics and Previous: Solution

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 14:10:26 GMT 1996