title: character input error in my C program?
body: <p>I am new to C programming, I have made a simple calculator program in C.
  <br>The program runs but doesn't work, it works till value for <code>b</code> is entered after then when character input comes it <em>doesn't ask</em> for the input. I don't know why this is happening but is there any fix?</p>
  
  <p>here's my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      float a,b;
      char op;
      printf("enter a: ");
      scanf("%f",&amp;a);
      printf("enter b: ");
      scanf("%f",&amp;b);
      printf("enter operation: ");
      scanf("%c",&amp;op);
      switch(op)
      {
          case '+':
              printf("\n%.2f %c %.2f = %.2f",a,op,b,a+b);
              break;
          case '-':
              printf("\n%.2f %c %.2f = %.2f",a,op,b,a-b);
              break;
          case '*':
              printf("\n%.2f %c %.2f = %.2f",a,op,b,a*b);
              break;
          case '/':
              printf("\n%.2f %c %.2f = %.2f",a,op,b,a/b);
              break;
          default:
              printf("invallid input!!");
      }
      return 0;
  }
  </code></pre>
  
  <p>The program seems to be absolutely correct but still there is something there I am missing. Answers are appreciated. </p>