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 is the most efficient way to count the number of bits which are set in an integer?

1067


What should malloc(0) do?

1128


Is c compiled or interpreted?

1196


What do you mean by Recursion Function?

1130


What are the modifiers available in c programming language?

1225


Can a variable be both static and volatile in c?

1045


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2450


What is pointer to pointer in c?

1116


Write a program to reverse a string.

1086


What is the usage of the pointer in c?

1141


Define Spanning-Tree Protocol (STP)

1136


What is static identifier?

1225


Which built-in library function can be used to match a patter from the string?

1303


How #define works?

1113


What is the use of pragma in embedded c?

1063