title: in while loop scanf gets skipped second time
body: <p>Well I am new to programming. I have problem with my code. In first run it works fine, but in second run it skips scanf and comes out of loop while debugger shows ch is still y and one more thing debugger shows is that in second iteration it does not reach to scanf. And even if the scanf gets skipped, why does control comes out of loop as value of ch has not changed. Kindly help me out.</p>
  
  <pre><code>    #include&lt;stdio.h&gt;
  
      int main()
      {
          char ch=y;
          while(ch==y || ch==Y)
          {
          printf("Its hello again to check\n");
          printf("Do you wish to continue: y or n\n");
          scanf("%c", &amp;ch);
      }
      exit(0);
      }
  </code></pre>
  
  <p>And if I modify this code again like below
          #include</p>
  
  <pre><code>    int main()
      {
          char ch=y;
          while(ch==y || ch==Y)
          {
                  printf("Its hello again to check\n");
                  printf("Do you wish to continue: y or n\n");
                  scanf("%c", &amp;ch);
                  //fflush(stdin);
                  printf("Choice entered %d \n", ch);
          }
          exit(0);
      }
  </code></pre>
  
  <p>It then last printf gets skipped even if I use fflush.</p>