Friday, July 31, 2009

Wat wil b d source code f u r 2 input the number & d output wil b d word of d corresponding number e.g. 1-one?

it is a code on a visual c++ language. if am going to input number "1" the output will the word "one". how wil i solve this problem? could you help me? to all programmers i need you help


plsssssssssssss!!!!!

Wat wil b d source code f u r 2 input the number %26amp; d output wil b d word of d corresponding number e.g. 1-one?
Declare an 2-d array to store numbers converted into words.


char nums[][];


nums[0] = "zero";


nums[1] = "one"; ... like this initialize with required numbers upto 99 or what ever you want.





Divide the number by 10. Take the reminder and use that as subscript with the array to get the number.


For ex: if your input is 5, 5 % 10 gives 5.


nums[5] gives you Five.











Hope this is clear.


No comments:

Post a Comment