Challenge
Write a program to spell out a large number in English words.
Assumptions
- The input number positive whole number less than 1000 ie. (0<= N <= 10 billion)
Assumptions
- All the words in the output are displayed is in lower case.
Input
- The input number.
Output
- The number converted to words (spelled out).
Test cases
No. | Input - Number | Output- Spelling |
---|---|---|
1 | 1000 | one thousand |
2 | 2549 | two thousand, five hundred and forty-nine |
3 | 50001 | fifty thousand and one |
4 | 201303 | two hundred one thousand, three hundred and three |
5 | 1700029 | one million, seven hundred thousand and twenty-nine |
6 | 1290121100 | one billion, two hundred ninety million, one twenty-one thousand and one hundred |
Instructions
- Accept the input number a command-line argument.
- Write the logic to compute the number to words.
- Display the resulting output.