title: C: scanf() inside a loop
body: <p>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 ?</p>
  
  <pre><code>int main()
  {
      char grade;
      int i=0;
  
      while(i&lt;10){
          printf("Enter ur grade\n");
          scanf("%c", &amp;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++;
  }
  </code></pre>