Write a program in c to input a 5 digit number and print it
in words.
Answer Posted / rakesh.bit
# include <stdio.h>
int main ()
{
int n,temp,t,s=0,i,ctr=0;
char a[10][10] = {"zero", "one", "two", "three", "four",
"five", "six", "seven", "eight", "nine"};
printf ("Enter the number:\n");
scanf ("%d", &n);
//printf ("The given num in word = %s\n", a[n]);
t=n;
while(n>0)
{
ctr++;
n=n/10;
}
while(t>0)
{
temp=t%10;
s=10*s+temp;
t=t/10;
}
for(i=0;i<ctr;i++)
{
printf("%s",a[s%10]);
s=s/10;
}
}
| Is This Answer Correct ? | 22 Yes | 16 No |
Post New Answer View All Answers
what is the height of tree if leaf node is at level 3. please explain
Should I learn data structures in c or python?
When is a null pointer used?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What are multibyte characters?
Difference between Function to pointer and pointer to function
What is keyword in c?
What is linear search?
What is static and volatile in c?
What are structural members?
What is f'n in math?
What is I ++ in c programming?
Explain what math functions are available for integers? For floating point?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
Multiply an Integer Number by 2 Without Using Multiplication Operator