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 difference between exit() and _exit() function in c?

1070


Find MAXIMUM of three distinct integers using a single C statement

1058


How can I change the size of the dynamically allocated array?

1144


What are reserved words?

1107


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1171


What is dangling pointer in c?

1212


How can I swap two values without using a temporary?

1097


what are enumerations in C

1158


What does malloc () calloc () realloc () free () do?

1060


The file stdio.h, what does it contain?

1154


What is the difference between malloc() and calloc()?

1832


Differentiate fundamental data types and derived data types in C.

1030


Explain how can I read and write comma-delimited text?

1159


What are directives in c?

966


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2773