Write a program that converts numbers to words. For example, 895 results in "eight
nine five."
here are my codes:
#include<stdio.h>
#include<stdlib.h>
int main()
{
printf(">>This program converts numbers to words :)\n");
int value;
printf("Enter value: ");
scanf("%d",&value);
switch(value){
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;}
}
system("pause");
return 1;
}
My problem here is that when i enter 4 the program disply four, but when i enter 45 there is nothnig displayed on the window!! and it should have display four five. Please help me with some explanation?