This program doesn't seem to accept input at every iteration of the while loop, when ideally it should.However when I replace the %c parameter of the scanf() function with %d ( i.e an integer input rather than a char input) it seems to just work absolutely fine, which input accepted for every iteration of the while loop. Why do I see this discrepancy ?
int main()
{
char grade;
int i=0;
while(i<10){
printf("Enter ur grade\n");
scanf("%c", &grade);
switch(grade){
case 'A' : printf("U R THE BEST\n");
break;
case 'B' : printf("U R VERY GOOD DUDE...\n");
break;
case 'C' : printf("U R GOOD DUDE...\n");
break;
case 'D' : printf("U R Not good DUDE...\n");
break;
case 'E' : printf("U R WORST DUDE...\n");
break;
default : printf("U r AWESOME...\n");
break;
}
i++;
}