![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYyYZia9VZlyimlR6PUdcuVtyp5pstWFIKCPKPwHb8k0rYvzaouapkmVhzQU_OoN1bX9dWAIzbf2g5IcVZ7rMD6bvn8VK4-UzKf6jT3pJs9s8tlA1KJx6Ow38mbMpj6HvCTogBviqOvvBG/s640/Digit+to+word+C+Program.jpg)
This is a C Program to convert digit into word using switch cases.
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
/** C Program to convert digit into word using switch by SlashMyCode.com **/
int d;
clrscr();
printf("Enter a Digit(0 to 9): ");
scanf("%d",&d);
switch(d)
{
case 0:
printf("Zero\n");
break;
case 1:
printf("one\n");
break;
case 2:
printf("Two\n");
break;
case 3:
printf("Three\n");
break;
case 4:
printf("Four\n");
break;
case 5:
printf("Five\n");
break;
case 6:
printf("Six\n");
break;
case 7:
printf("Seven\n");
break;
case 8:
printf("Eight\n");
break;
case 9:
printf("Nine\n");
break;
default:
printf("you entered invalid digit\n");
break;
}
/** C Program to convert digit into word using switch by SlashMyCode.com **/
getch();
}
Output:
Flowchart:
No comments:
Post a Comment
Feel free to ask us any question regarding this post