Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are identifiers in c?

1144


Tell us bitwise shift operators?

1022


What is signed and unsigned?

1013


What is the difference between typedef and #define?

991


What does struct node * mean?

965


What is union in c?

1060


Which one would you prefer - a macro or a function?

1033


When was c language developed?

1140


How do you do dynamic memory allocation in C applications?

1044


What are the features of c language?

1021


The file stdio.h, what does it contain?

1115


What is a static variable in c?

1066


How many main () function we can have in a project?

1064


What is the symbol indicated the c-preprocessor?

1166


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1923