Write a program in c to input a 5 digit number and print it
in words.

Answers were Sorted based on User's Feedback



Write a program in c to input a 5 digit number and print it in words...

Answer / 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

More C Interview Questions

What is the difference between variable declaration and variable definition in c?

0 Answers  


how can i get output the following... 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 and 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 plz plz...

3 Answers  


how to determine the complexity of an algorithm as log(n)

1 Answers   Google,


What is the difference between exit() and _exit() function?

0 Answers  


What is main function in c?

0 Answers  






How do you view the path?

0 Answers  


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

0 Answers  


What do you understand by normalization of pointers?

0 Answers  


Explain the priority queues?

0 Answers  


What is bash c?

0 Answers  


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

0 Answers   Celstream,


What is class and object in c?

0 Answers  


Categories