Completely Solved C, C++ Programs Assignment.




C Program to accept any single digit number and print it in words

Filed Under:

Problem 33. C Program to accept any single digit number and print it in words .
#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( );
}

C compiler: gcc 4.1.2

  Back to main directory: Sample C Program | Software Practical | Solved C Assignment


Get Free Programming Tutorials and Solved assignments