How do I change intergers in a string to their word equivalent (ie 1=one, 2=two)
Code:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main(int argc, char *argv[])
{
int n1;
int i=0;
char str1[100];
char str2[100];
printf("Please enter 1st number: ");
scanf("%s", str1);
printf("\nPlease enter 2nd number: ");
scanf("%s", str2);
printf("\nConcatenation of 1st & 2nd: %s\n", strcat(str1, str2));
getchar();
n1 = atoi( strcat(str1, str2) );
printf("\nOnly Digits of the Concatenation: %d\n", n1);
system("PAUSE");
return 0;
}
This program so far asks for 1st string and 2nd string, then adds them together, then removes any letters, the next part I need to change all the digits its found to their word equivalent (ie 1=one, 2=two)