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
what value is returned to operating system after program execution?
When was c language developed?
Why array is used in c?
What is the purpose of scanf() and printf() functions?
What is wild pointer in c?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
What is storage class?
Why is c not oop?
How do you declare a variable that will hold string values?
Explain what is a program flowchart and explain how does it help in writing a program?
How can I split up a string into whitespace-separated fields?
What are near, far and huge pointers?
Why shouldn’t I start variable names with underscores?
Explain what is the benefit of using #define to declare a constant?
How do I get an accurate error status return from system on ms-dos?