Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
sure, sure. i've got nothing better to do than do your homework.
shall i also write your report, bind it, and mail it first class to your instructor?
jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
Consider this
23 = Twenty three
123 = One hundred and twenty three
123,000 = One hundred and twenty three thousand
So you need to think about (eventually)
- splitting into groups of 1000
- splitting hundreds from tens and units
But start simple, try to code up converting 1 to 99.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
The following example-code will 'convert' an int into a char
int number = 97; //97 is the ascii value of 'a'
char character = (char)number; // "convert" it
printf("%c", character);
A char and an int are both numbers, they just differ in the way us humans read them :) ascii-table
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
char *ones[ ] = { "zero", "one", "two", "three" };
char *tens[ ] = { "none", "ten", "twenty" };
int n = 23;
printf( "%s %s", ones[n%10], tens[n/10] );
It's too big a clue to explain, you'll just have to figure it out.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
So that's all you've got to show for another day's help, and maybe you thinking about the problem some more (or maybe - shock horror - actually trying something for yourself).
Just post the same question again.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
...Cmon la tel me how to make the decimal putput tat read the output point zero one?
I knew I should have keep my copy of the Rosetta Stone.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218
> .Gt any good idea to solve it?
Yeah, exactly the same way that you solved the part before the decimal point.
It's all the same technique.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953