write a c code "if you give a any decimal number then print that number in english alphabet"?
ex: i/p: 552
o/p: five hundred fifty two ...
#include<stdio.h>
void main()
{
int number,i=0,j,digit;
char * word[1000];
printf("Enter number
");
scanf("%d",&number);
while(number){
digit = number %10;
number = number /10;
switch(digit){
case 0: word[i++] = "zero"; break;
case 1: word[i++] = "one"; break;
case 2: word[i++] = "two"; break;
case 3: word[i++] = "three"; break;
case 4: word[i++] = "four"; break;
case 5: word[i++] = "five"; break;
case 6: word[i++] = "six"; break;
case 7: word[i++] = "seven"; break;
case 8: word[i++] = "eight"; break;
case 9: word[i++] = "nine"; break;
}
}
for(j=i-1;j>=0;j--){
printf("%s ",word[j]);
}
}
| Is This Answer Correct ? | 1 Yes | 5 No |
can anyone please tell about the nested interrupts?
What is the diffrent between while and do while statement ?
what will be the output of" printf("%d%d",scanf("%d% d",&a&b));"
Is there any book to know about Basics of C Language?
What is 1d array in c?
How can I find the modification date of a file?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
How to define structures? ·
what is computer
how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.
Can anyone tell what is stack overflow? what precaution we should take?
What are the commands should be given before weiting C Program i.e, Cd.. like
4 Answers IBM, Infonet, Satyam, Tech Mahindra,