C Program to print the two digit number in words

The following is a C program to print the two digit number in words:

Expected Output:

1st run:

2nd run:

How it works

The program consists of two outer switch statements. The first one is defined in lines 17-78 and the second one is defined in lines 81-110. The first switch statement prints the word for the first digit and the second switch statement print the word for the second digit. Numbers from 11 to 19, require special treatment and are handled by the nested switch statement defined in lines 21-53.


Recommended Reading

Leave a Comment

%d bloggers like this: