Write a function that will convert a 5-digit (positive) number into word form.
Eg: 123, the output should be one hundred and twenty three...
(this should be a c++ program).
I need a c++ program to convert Number to word form.?
Very well, you need a program. What is your question? Do you want smbdy to do your homework for you?
%26gt; This is not my homework...
%26gt; This is the program i have to take for my seminar...
Oh, that makes a big difference, lol!
%26gt; i can't sit in front of my pc for long n work on this coz i have a lots of headache...
What about programming books? Can you read them? Can you write? This program is not large, you can always try to write it on paper - then you'll need just to type it, compile and run, it'll not take you much time. If you get any errors, write'em down, return back to your papers and analyze your code. Actually, that was the way programmers work in times "when computers were big" - this is not very quick way, but it helps to improve your programming much.
Reply:I can't give you the code, but here is how you do it.
First separate the digits: by taking the modulus(%) of the nuber by ten eg. no%10, do this in a loop. Get the answer in another variable t[4]; and subtract it from the main number ie. no=no-t[i];
I is the counter that increments with every loop;
In a charater variable sent[100];
Start with t[3]; and t[2] put it as as
cout%26lt;%26lt;t[3]*10+t[2] "thousand", print it.
go on like this till you come to 0;
Hope you can understand and this helps
Reply:Do your own homework.
But you can ask for help on a specific problem here:
http://cboard.cprogramming.com/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment