title: Why my while loop in not getting repeated in this switch case?
body: <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      int a;
      scanf(&quot;%d&quot;, &amp;a);
      int if_again = 1;
      int c = 1;
      switch (a)
      {
      case 1:
          while (if_again == 1)
          {
              scanf(&quot;%d&quot;, c);
              if (c == 1)
              {
                  if_again == 1;
              }
              else
              {
                  if_again == 0;
              }
          }
      }
      return 0;
  }
  </code></pre>
  <p>It is getting terminated after giving 1 two times only, but it should keep on getting repeated until 0 is entered. What is wrong with my code?</p>