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 |
What is the concatenation operator?
What is getche() function?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is meant by initialization and how we initialize a variable?
Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); 1) 10 2) 11 3) 1
Explain what is the difference between #include and #include 'file' ?
Explain what is gets() function?
What is the acronym for ansi?
Who developed c language and when?
What are 'near' and 'far' pointers?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is an array? What the different types of arrays in c?