c program to convert numbers into words
Example:
input: 4232
output: four two three two
program:
#include<stdio.h>
#include<string.h>
int main()
{
char number[50];
printf("enter number");
scanf("%s",&number);
int len=strlen(number);
printf("\n");
int i;
for(i=0;i<len;i++)
{
switch(number[i])
{
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("entered non number character");
}
}
return 0;
}