Write a program in c to input a 5 digit number and print it
in words.
Answer Posted / vignesh1988i
#include<stdioi.h>
void main()
{
int n,count=0,a[20];
scanf("%d",&n);
for(i=0;n>0;i++)
{
a[i]=n%10;
n=n/10;
count++;
}
for(i=0;i<count;i++)
{
switch(a[i])
{
case 1:
printf("one");
break;
case 2:
printf("two");
break;
like this print upto case 0 , (ie) after case 9 ... put
case 0.... and finish the switch and close the loop.......
| Is This Answer Correct ? | 119 Yes | 186 No |
Post New Answer View All Answers
How can I open a file so that other programs can update it at the same time?
What is extern storage class in c?
What does c value mean?
Write a c program to demonstrate character and string constants?
What is variable in c example?
Is malloc memset faster than calloc?
What is data structure in c and its types?
What does c in a circle mean?
What is the difference between near, far and huge pointers?
What is mean by data types in c?
What are the differences between Structures and Arrays?
What is the difference between call by value and call by reference in c?
What is bin sh c?
What is sorting in c plus plus?
What does s c mean in text?