title: My program skip getting input data?
body: <p>I have written a simple program to exchange currency and able to buy a beer.</p>
  
  <p>But there something in program and I don't know why, it auto skips the third input data -> end program.</p>
  
  <p>Here my code :</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int ex_rate_into_vnd = 20000; //! Exchange Rate
      int beer = 7000; //! Local price of a beer
      float in_c = 0; //! Input amount of money
      float out_c = 2; //! Amount of currency to exchange !
      float choice; //! Switch mode
      char buy; //! Deal or not
  
      //! Introduction
      printf ("||---------------------------------------------------||\n");
      printf ("||         Currency Exchange Machine  beta           ||\n");
      printf ("||---------------------------------------------------||\n");
  
      printf ("Please choose your option:\n");
      printf("\t 1.Exchange VND to dollar\n");
      printf("\t 2.Exchange Dollar to VND\n");
  
      do
      {
          printf("Your choice: ",choice);
          scanf("%f",&amp;choice);
      } while( choice != 1 &amp;&amp; choice != 2);
  
      printf ("Please enter amount of money:");
      scanf("%f",&amp;in_c);
  
      if (choice == 1 )
          {
              out_c = in_c / ex_rate_into_vnd;
              printf ("Your amount of money: %.2f",out_c);
          }
      else
          {
             out_c = in_c * ex_rate_into_vnd;
             printf ("Your amount of money: %.0f",out_c);
          }
  //! End of Exchanging
  
      printf ("\nWould you like to buy a beer (y/n) ?",buy);
      scanf("%c", &amp;buy);
  
      if (buy == 'y')
          {
          if (out_c &gt;= 7000)
              {
                  out_c = out_c - 7000;
                  printf("Transactions success !\n");
                  printf("Your amount: %2.f",out_c);
              }
          }
      printf ("\nWhy Stop ?");
  
  
      return 0;
  }
  </code></pre>