Challenge
Write a program to spell out a small number in English words.
Assumptions
- The input number positive whole number less than 1000 ie. (0<= N <=999)
Requirements
- All the words in the output are displayed is in lower case.
Input
- The input number.
Output
- The number convert to words (spelled out).
Test cases
No. | Input - Number | Ouput- Spelling |
---|---|---|
1 | 1 | one |
2 | 11 | eleven |
3 | 25 | twenty-five |
4 | 80 | eighty |
5 | 100 | one hundred |
6 | 724 | seven hundred and twenty-four |
7 | 890 | eight hundred and ninety |
Instructions
- Accept the input number an command line argument.
- Write the logic to compute the number to words.
- Display the resulting output.