100 Most Important C# Programs
33. Program to accept any single digit number and print it in words .
Code:
# include <stdio.h>
# include <conio.h>
main( )
{
int n;
clrscr( );
printf(“enter a number :”);
scanf(“%d “,&n);
switch(n)
{
case 0: printf(“ZERO”);
break;
case 1: printf(“ONE”);
break;
case 2: printf(“TWO”);
break;
case 3: printf(“THREE”);
break;
case 4: printf(“FOUR”);
break;
case 5: printf(“FIVE”);
break;
case 6: printf(“SIX”);
break;
case 7: printf(“SEVEN”);
break;
case 8: printf(“EIGHT”);
break;
case 9: printf(“NINE”);
break;
default:
printf(“please enter the number between 0
and 9”);
}
getch( );
}