Quote:
Originally Posted by aravindan333
Hi guys, i need rough code for a program.The question is as follows,
pgm:
if you press 1 in your keyboard, it have to display in letters "one", similarly it should display upto a three digit number 101----->"one hundred and one", i need the code in c++, i just need the logic don't need to be very accurate. If you guys have any idea post it here please

1) read the numbers from the user
2) check to see if the number is >=0 and <=999 (up to 3-digit number)
if not goto 1
3)declare a char array to hold your answer
4)declare a char array ([][])to contain "zero","one",....."ten","eleven",..."twenty"
declare a char array to contain "ten","twenty",...."ninety"
5) include string.h in your code
6) use strcpy,strcat to create the correct answer
start coding and post your code here to help you.