Example 86: Conversion from Number to Words

Learn how to convert a number into words.

Problem

Write a program that receives an integer (less than or equal to nine digits in length) and prints out the number in words.

Example

Input Output
12342 Twelve Thousand Three Hundred Forty Two
4567 Four Thousand Five Hundred Sixty Seven
100000 One Hundred Thousand

Try it yourself

Try to solve this question on your own in the code widget below. If you get stuck, you can always refer to the solution provided.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.