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

 

Decimal to Roman Numerals Conversion

Using a SELECT CASE block and integer division 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.

tabular1371

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

Go back to Notes gif




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

©University of Liverpool, 1997
Thu May 29 10:11:26 BST 1997
Not for commercial use.