Hey guys, I finished the program i was stumped with. After rereading and thinking more about it, it became abundantly clear and following your useful advice CommomTater.
Code:
#include <stdio.h>
#include <stdlib.h>
char ch,a,b,c;
main()
{
do{
printf("\nEnter charater: ");
ch=getche();
switch(ch){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
a++;
break;
case ';':
case ':':
case '.':
case '>':
case ',':
case '<':
case '/':
case '?':
case '"':
b++;
break;
default :
c++;
}
} while (ch!='\r');
printf("There are %d numbers, %d punctuation, %d letters.",a,b,c);
}
Just wanted to say thanks, and I know this isn't the optimal way to do it but the exercise was supposed to use switch.