title: It prints The printf statement twice
body: <p>This is really strange it prints this line <code>printf("Do you want to continue Yes (Y) or No (N): \n");</code> Not using any loop nothing but still it prints that statement twice</p>
  
  <pre><code>int main()
  {
  
  int led=0;
  int ohm=0;
  char check;
  int flag=0;
  
  while (led &lt; 1 || led &gt; 3){
      printf("Enter the number of switch you want to close: \n\n");
      printf("  ********************     Press 1 for switch (LED) 1     ********************\n");
      printf("  ********************     Press 2 for switch (LED) 2     ********************\n");
      printf("  ********************     Press 3 for switch (LED) 3     ********************\n");
  
      printf("Switch: ");
      scanf("%d", &amp;led);
  }
  
  printf("\n\n");
  while (ohm &lt; 1 || ohm &gt; 3){
      printf("Enter the resistance of Rheostat: \n\n");
      printf("  ********************     Press 1 for 10 ohm resistance  ********************\n");
      printf("  ********************     Press 2 for 20 ohm resistance  ********************\n");
      printf("  ********************     Press 3 for 30 ohm resistance  ********************\n");
  
      printf("Resistance: ");
      scanf("%d", &amp;ohm);
  }
  
  
      while (flag == 0)
      {
          //LED-1
          if(led== 1 &amp;&amp; ohm== 1 )
          {
              printf("LED-1 is blinking 2 times\n");
          }
  
          if(led== 1  &amp;&amp; ohm== 2)
          {
              printf("LED-1 is blinking 4 times\n");
          }
  
          if(led== 1  &amp;&amp; ohm== 3 )
          {
              printf("LED-1 is blinking 6 times\n");
          }
  
          //LED-2
          if(led== 2  &amp;&amp; ohm== 1 )
          {
              printf("LED-2 is blinking 2 times\n");
          }
  
          if(led== 2  &amp;&amp; ohm== 2 )
          {
              printf("LED-2 is blinking 4 times\n");
          }
  
          if(led == 2  &amp;&amp; ohm == 3)
          {
              printf("LED-2 is blinking 6 times\n");
          }
  
          //LED-3
          if(led == 3  &amp;&amp; ohm == 1 )
          {
              printf("LED-3 is blinking 2 times\n");
          }
  
          if(led == 3  &amp;&amp; ohm == 2)
          {
              printf("LED-3 is blinking 4 times\n");
          }
  
          if(led == 3 &amp;&amp; ohm == 3)
          {
              printf("LED-3 is blinking 6 times\n");
          }
  
          led = 0;
          ohm = 0;
          printf("Do you want to continue Yes (Y) or No (N): \n");
          scanf("%c", &amp;check);
  
          if(check =='Y' || check =='y')
          {
  
              while (led &lt; 1 || led &gt; 3){
              printf("Enter the number of switch you want to close on: ");
              scanf("%d", &amp;led);
              }
  
              while (ohm &lt; 1 || ohm &gt; 3){
              printf("Enter the resistance of Rheostat: ");
              scanf("%d", &amp;ohm);
              }
          }
  
          if(check=='N' || check=='n')
          {
              printf("Thanks for using the program");
              flag = 1;
          }
  
  
  
      }
      return 0;
  
  }
  </code></pre>