0

So what I posted should theoretically handle 0 to 999
nine hundred ninety-nine

0 to 9,999 isn't to hard either.
Above that you can handle with a resursion
nine hundred ninety-nine thousand nine hundred ninety-nine

0

thanks mate but there 1 thing i dont understand when you sprintf the num whish is bigger than 100 it should like print 2 variables not 3 ? how it printed 3?

0

shoudlnt it be like this "%s %s %s\n",string,string[28],string[num]); ?

0

You are breaking down your number into its component parts then re-assembling the ASCII into a string.

There are many ways to write the same program.

All the $printf() functions return the length of bytes built.
i = printf()
i = sprintf()
i = fprintf()
i = vprintf()
etc.
That's why I use the return addition onto the base pointer to advance it for the next parse.

You can build your strings in one line but I merely concatenate the new strings onto the end.

Also you don't want "thirty zero"
But you do want "thirty-one"

Also note that written 10's requires a hyphen between it and the one's.

0

shoudlnt it be like this "%s %s %s\n",string,string[28],string[num]); ?

hlow can u help me?
about Zodiac sign ?here is the the output :
sample output
Enter Name:Anjoe
Enter Birthyear:02/08/92
name:Anjoe
age:17
Zodiac sign:tiger
using array,modulo,&looping statement instructor said

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.