next up previous
Next: Concatenate Names Up: Control StructureIntrinsics and Previous: Mathematical Magic

 

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.

tabular1369

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
Next: Concatenate Names Up: Control StructureIntrinsics and Previous: Mathematical Magic

Adam Marshall ©University of Liverpool, 1996
Wed Oct 9 17:39:48 BST 1996