This code i made divided a user input into characters and non character. The problem im having is that if a mixed sentence is created, such as 32B, it will only print the 'char string' and not the 'non char string'. But when the sentence is just non characters like 32 it will print the 'non-char string'. So essentially if a mixed sentences is created both of the strings won't be created or printed.(This is only a function by the way).
Code:
Count_chars( char Input[])
{
int i;
for(i = 0; Input[i]; i++)
{
if((Input[i] <= 122) &&(Input[i] >= 97)){
printf("Char %c\n",Input[i]);
Char[i] = Input[i];
}
else{
printf("Non-Char %c \n",Input[i]);
NonChar[i] = Input[i];
}
}
printf("%s Char String\n",Char);
printf("%s NonChar String\n",NonChar);
return;
}