Why this code is not getting valid for 10 ?
#include <stdio.h> #include <string.h> #include <ctype.h> int main() { char s[50]; int n; fgets(s,50,stdin); n=strlen(s); for (int i=0;i<n;i++) { if(isdigit(s[i])&&(isdigit(s[i+1])!='0')) { switch(s[i]) { case '1': printf("one");break; case '2': printf("two");break; case '3': printf("three"); break; case '4': printf("four");break; case '5': printf("five");break; case '6': printf("six");break; case '7': printf("seven");break; case '8': printf("eight");break; case '9': printf("nine");break; // case '10':printf("ten");break; default: printf("zero");break;}} else if((isdigit(s[i])=='1')&&(isdigit(s[i+1])=='0')) { printf("ten"); } else { printf ("%c",s[i]); } } return 0; }