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

Explain what are the different data types in c?

0 Answers  


write a program fibonacci series and palindrome program in c

0 Answers   Aditi Placement Service,


What is main void in c?

1 Answers  


Program to find largest of three numbers without using comparsion operator?

3 Answers  


What are loops in c?

0 Answers  






State the difference between x3 and x[3].

0 Answers   Aricent,


What are valid operations on pointers?

0 Answers  


Can u please send me the exam pattern and also Previous papers to javed123go@gmail.com

0 Answers  


Why do we use pointer to pointer in c?

0 Answers  


Why do we use namespace feature?

0 Answers  


what will the following program do? void main() { int i; char a[]="String"; char *p="New Sring"; char *Temp; Temp=a; a=malloc(strlen(p) + 1); strcpy(a,p); //Line no:9// p = malloc(strlen(Temp) + 1); strcpy(p,Temp); printf("(%s, %s)",a,p); free(p); free(a); } //Line no 15// a) Swap contents of p & a and print:(New string, string) b) Generate compilation error in line number 8 c) Generate compilation error in line number 5 d) Generate compilation error in line number 7 e) Generate compilation error in line number 1

1 Answers   IBM,


Can you please explain the difference between strcpy() and memcpy() function?

0 Answers  


Categories