By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

how to convert number into words in c++

P: 2
i hd got a question to display the entered number ie any number to words in c++...??? say for eg: if we enter 10225,
thn it would display ten thousand two hundred and twenty five on the screen.....
if anyone knws the answer pls reply
thnx
Feb 22 '12 #1

✓ answered by weaknessforcats

Say you have 123. Ten 123/100 is 1. So you have one hundred.
Subtract 1* 100 from 23 to get 23.

Repeat the above using 23/10. Which is 2. So you have twenty.
Subtract 2 * 10 from 23 which leaves 3.

3 is three.

You can do this in a loop.

Good luck.

Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Say you have 123. Ten 123/100 is 1. So you have one hundred.
Subtract 1* 100 from 23 to get 23.

Repeat the above using 23/10. Which is 2. So you have twenty.
Subtract 2 * 10 from 23 which leaves 3.

3 is three.

You can do this in a loop.

Good luck.
Feb 22 '12 #2

P: 2
bt sir...we have to done the program with an array......
can u pls demonstrate the program for me...???
Feb 26 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.