First, separate your given number in to tens and ones. (e.g. if your number is 23,
int tens = 2;
and
int ones = 3;
.) You can use the modulus operator to accomplish this programmatically.
Next, use a switch statement to print the name of the tens digit.
switch( tens )
{
case 2:
printf("twenty");
case 3:
printf("thirty");
}
Finally, use a second switch statement to print the name of the ones digit:
switch( ones )
{
case 1:
printf("one")
case 2:
printf("two");
}
That's it!
-PaulH
Edit: It looks to me like he's asking for guidance, not cheating.