Converting Numbers to Words in English by recursion.



I am trying to convert numbers to there corresponding words but it
only works for numbers under 1,000 but need it to work for 1 billion.

Here is the code I have so far:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

/* Prototype */
void print_num(int num);

char *digits[] = {
"zero", "one", "two", "three", "four", "five",
"six", "seven", "eight", "nine"};

char *tens[] = {
"ten", "twenty", "thirty", "fourty", "fifty", "sixty",
"seventy", "eighty", "ninety"};

char *places[] = {"hundred", "thousand", "hundred", "million",
"hundred", "billion"};

int main(){

int num = 120394;

print_num(num);
printf("%d ", num); /* Print that number */

}

/* Print out the number sequence */
void print_num(int num){


if(num < 10){
printf("%s ", digits[num]);

}
else if(num < 100){
//print_num(num/10);
printf("%s ", tens[num/10]);
print_num(num%10 +1);
}

else if(num < 1000){
print_num(num/100);
printf("%s ", places[num/1000]);
print_num(num/10);

}else{


print_num(num/10);
print_num(num%10);

}
}

.