‘C’ program to print digit into word
C File =>
/* Write ‘C’ program to accept a single digit and display it in words. For
example, Input = 9 Output = Nine */
#include<stdio.h>
int main()
{
int n;
printf("\n Enter single digit number : ");
scanf("%d",&n);
switch(n)
{
case 0:printf("\n Zero");
break;
case 1:printf("\n One");
break;
case 3:printf("\n Three");
break;
case 4:printf("\n Four");
break;
case 5:printf("\n Five");
break;
case 6:printf("\n Six");
break;
case 7:printf("\n Seven");
break;
case 8:printf("\n Eight");
break;
case 9:printf("\n Nine");
break;
default:printf("\n Invalid input");
}
return 0;
}
Comments
Post a Comment
Please do not enter any spam link in message.