title: Having trouble with do while loops in C
body: <p>I am a beginner at C and I am writing a basic program that converts dollars to euros. For some reason the program is not running this line: "scanf("%c", &amp;yn);". If I remove the do while loop the program works fine.</p>
  
  <p>Instead of stopping and waiting for the user to enter 'y' or 'n' the loop restarts and asks for the usd amount again.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  main()
  
  {
      float usd = 0.00;
      float euro = 0.00;
      char yn;
      const float conversion = 0.75;
  
      do {
          /*get amount to convert*/
          printf("Please enter the amount of USD you want to convert to Euros: ");
          scanf("%f", &amp;usd);
  
          /*convert amount*/
          euro = (usd * conversion);
  
          /*output results and ask to continue*/
          printf("\n%.2f USD equals %.2f Euros. Do you want to convert another amount? (y/n): ", usd, euro);
          scanf("%c", &amp;yn);
          printf("\n");
  
  
          /*if yes, get new amount to convert. if no, program ends*/
      } while (yn = 'y');
  
      return 0;
  }
  </code></pre>
  
  <p>Thanks in advance.</p>