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 program in c to input a 5 digit number and print it
in words.

Answer Posted / rakesh.bit

# include <stdio.h>
int main ()
{
int n,temp,t,s=0,i,ctr=0;
char a[10][10] = {"zero", "one", "two", "three", "four",
"five", "six", "seven", "eight", "nine"};
printf ("Enter the number:\n");
scanf ("%d", &n);
//printf ("The given num in word = %s\n", a[n]);
t=n;
while(n>0)
{
ctr++;
n=n/10;
}
while(t>0)
{
temp=t%10;
s=10*s+temp;
t=t/10;
}

for(i=0;i<ctr;i++)
{
printf("%s",a[s%10]);
s=s/10;
}
}

Is This Answer Correct ?    22 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the height of tree if leaf node is at level 3. please explain

2121


Should I learn data structures in c or python?

996


When is a null pointer used?

1078


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1114


What are multibyte characters?

1079


Difference between Function to pointer and pointer to function

1037


What is keyword in c?

983


What is linear search?

1108


What is static and volatile in c?

1198


What are structural members?

977


What is f'n in math?

1032


What is I ++ in c programming?

1086


Explain what math functions are available for integers? For floating point?

1082


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

1131


Multiply an Integer Number by 2 Without Using Multiplication Operator

739