English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

write a program to print and given number in words... say for example... if the input is 12345 then the output should be printed as "twelve thousand three hundred and fourty five" can someone help me how to write a program for this in c. waiting for the reply. thanking you.

2006-07-09 20:21:22 · 5 answers · asked by yaameen786 1 in Computers & Internet Programming & Design

5 answers

You can get the C code to convert number to words at the link below:

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1512&lngWId=3

2006-07-09 20:33:11 · answer #1 · answered by Vj. 2 · 0 0

While I'd love to help you, this just isn't the right place to ask.

Try:

http://www.nerdbrains.com

And this is really not all that difficult. Ask for an input from a user. Then, compare the value of the input against 10,000, 20,000, 30,000, 40,000... then 1,000, 2,000, 3,000, 4,000, and so forth. Using IF loops inside functions, this can be easily programmed. That is the "dumb" way.

If you want, use tables and arrays. They work magic as well. I dobut anyone will actually program it for you. If you get everyone to do all the work, then you never learn programming.

2006-07-10 03:27:40 · answer #2 · answered by WhisperBlade 2 · 0 0

Get your prep work done.

You'll need a two dimensional array set up with the words needed.

One, two, three, etc...ten, twenty, thirty, forty, etc...hundred, thousand, million, etc.

One done you will need to have the number as a string which you should be able to tell the length and the contents. By using the length you can tell which to use for thousand, hundred, etc. Your program will take information from the array and display it according to the number entered.

2006-07-10 03:27:22 · answer #3 · answered by David W 4 · 0 0

it needs some time...
well if u know the basics...
Use switch cases withdevisio % modulo operator..

2006-07-10 03:29:03 · answer #4 · answered by vishnu 2 · 0 0

Do your own homework.

2006-07-10 04:11:52 · answer #5 · answered by glenbrent 2 · 0 0

fedest.com, questions and answers