yes..
 one[] = {"", "one", "two", ...............,
"nine","ten", ........"nineteen"};
 tens[] = {"", "", "twenty", "thirty",......"ninety"};
and store hundred[], thousand[] etc then
check that how many digits are there, if the given number is a single
digit then print: one[n]
if the given number is having two digits then do :
    if(n>19) print(ten[n/10] , one[n%10]);
    else print(one[n]);
if the given number is having three digits then do:
    print(one[n/100]);
    printf("hundred");
    p = n / 10;
    printf(ten[p%10], one[n%10]);

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to