write a c program to accept a given integer value and print
its value in words

Answers were Sorted based on User's Feedback



write a c program to accept a given integer value and print its value in words..

Answer / saurav kumar

#include<stdio.h>
int main()
{
int i,j,n;
int a[15];
printf("enter any number:");
scanf("%d",&n);
for(i=0;n>0;i++)
{
a[i]=n%10;
n=n/10;
}
for(j=i-1;j>=0;j--)
{
switch(a[j])
{
case 1:
printf("one ");
break;

case 2:
printf("two ");
break;

case 3:
printf("three ");
break;

case 4:
printf("four ");
break;

case 5:
printf("five ");
break;

case 6:
printf("six ");
break;

case 7:
printf("seven ");
break;

case 8:
printf("eight ");
break;

case 9:
printf("nine ");
break;

case 0:
printf("zero ");
break;

default:
printf("no number exists like this :");
}
}

Is This Answer Correct ?    30 Yes 9 No

write a c program to accept a given integer value and print its value in words..

Answer / uday

#include<stdio.h>
int main()
{
int n;
clrscr();
printf("\nenter a integer number::");
scanf("%d",&n);
switch(n)
{
case:1
printf("\nOne");
break;
case:2
printf("\nTwo");
break;
case:3
printf("\nThree");
break;
case:4
printf("\nFour");
brak;
case:5
printf("\nFive");
break;
case:6
printf("\nSix");
break;
case:7
printf("\nSeven");
break;
case:8
printf("\nEight");
break;
case:9
printf("\nNine");
break;
default:
printf("\nSorry");
}
getch();
}

Is This Answer Correct ?    19 Yes 41 No

write a c program to accept a given integer value and print its value in words..

Answer / sheikh rasel

#include<stdio.h>
int main()
{
int n;
clrscr();
printf("\nenter a integer number::");
scanf("%d",&n);
switch(n)
{
case:1
printf("\nOne");
break;
case:2
printf("\nTwo");
break;
case:3
printf("\nThree");
break;
case:4
printf("\nFour");
brak;
case:5
printf("\nFive");
break;
case:6
printf("\nSix");
break;
case:7
printf("\nSeven");
break;
case:8
printf("\nEight");
break;
case:9
printf("\nNine");
break;
default:
printf("\nSorry");
}
getch();
}

Is This Answer Correct ?    17 Yes 39 No

write a c program to accept a given integer value and print its value in words..

Answer / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
long int n;
int a[15];
printf("enter the number:");
scanf("%ld",&n);
for(int i=0;n>0;i++)
{
a[i]=n%10;
n=n/10;
}
for(int j=i;j>0;j--)
{
switch(a[j])
{
case 1:
printf("one ");
break;
case 2:
printf("two ");
break;
case 3:
printf("three ");
break;
case 4:
printf("four ");
break;
case 5:
printf("five ");
break;
case 6:
printf("six ");
break;
case 7:
printf("seven ");
break;
case 8:
printf("eight ");
break;
case 9:
printf("nine ");
break;
case 0:
printf("zero ");
break;
default:
printf("no number exists like this :");
}
}
getch();
}

Is This Answer Correct ?    7 Yes 29 No

Post New Answer

More C Interview Questions

application attempts to perform an operation?

0 Answers  


What is a 'null pointer assignment' error?

0 Answers  


what will be the out put. #include<stdio.h> void main() { printf("Output:"); printf(1+"vikashpatel"); }//output: ikashpatel

1 Answers   V2 Solutions,


what is an ERP?

2 Answers   Infotech,


What is c method?

0 Answers  


What does d mean?

0 Answers  


for (i <= 5 && i >= -1;++i; i > 0) { printf("%d ", i); }

1 Answers  


Write a C program where input is: "My name is xyz". output is: "xyz is name My".

1 Answers   TCS,


When should we use pointers in a c program?

0 Answers  


Display names and numbers of employees who have 5 years or more experience and salary less than Rs.15000 using array of structures (name, number, experience and salary)

1 Answers  


What is a scope resolution operator in c?

0 Answers  


What is the purpose of the fflush() function in C?

2 Answers  


Categories