title: While loop syntax error will not compile even when trying to break out
body: <p>I keep getting a syntax error and cannot find where i am not completing the loop. my program is to query for what to convert to then after it converts asks the user if they want to do it again and if yes, present option menu again.</p>
  <p>Can someone tell me where i am going wrong?</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  int main(void){ 
      char answer;
      int selection;
      int again = 0;
      printf(&quot;Select Conversion:\n&quot;);
      printf(&quot;(1.)Hex to Binary\n(2.)Binary to Hex\n&quot;);
      scanf(&quot;%d&quot;, &amp;selection);
      while (again != 1) 
      {
          if (selection ==1)
          {
              char bin2[1000], hexa2[1000];
              long int a = 0;
              printf(&quot;Enter a hex or binary value: &quot;); 
              scanf(&quot;%s&quot;, &amp;hexa2);
              printf(&quot;\nBinary value: &quot;);
              while (hexa2[a])
              {
                  switch (hexa2[a])
                  {
                  case '0':
                      printf(&quot;0000&quot;); 
                      break;
                  case '1':
                      printf(&quot;0001&quot;); 
                      break;
                  case '2':
                      printf(&quot;0010&quot;); 
                      break;
                  case '3':
                      printf(&quot;0011&quot;); 
                      break;
                  case '4':
                      printf(&quot;0100&quot;); 
                      break;
                  case '5':
                      printf(&quot;0101&quot;); 
                      break;
                  case '6':
                      printf(&quot;0110&quot;); 
                      break;
                  case '7':
                      printf(&quot;0111&quot;); 
                      break;
                  case '8':
                      printf(&quot;1000&quot;); 
                      break;
                  case '9':
                      printf(&quot;1001&quot;); 
                      break;
                  case 'A':
                      printf(&quot;1010&quot;); 
                      break;
                  case 'B':
                      printf(&quot;1011&quot;); 
                      break;
                  case 'C':
                      printf(&quot;1100&quot;); 
                      break;
                  case 'D':
                      printf(&quot;1101&quot;); 
                      break;
                  case 'E':
                      printf(&quot;1110&quot;); 
                      break;
                  case 'F':
                      printf(&quot;1111&quot;); 
                      break;
                  case 'a':
                      printf(&quot;1010&quot;); 
                      break;
                  case 'b':
                      printf(&quot;1011&quot;); 
                      break;
                  case 'c':
                      printf(&quot;1100&quot;); 
                      break;
                  case 'd':
                      printf(&quot;1101&quot;); 
                      break;
                  case 'e':
                      printf(&quot;1110&quot;); 
                      break;
                  case 'f':
                      printf(&quot;1111&quot;); 
                      break;
                  default:
                      printf(&quot;\n Invalid hexa digit %c &quot;, hexa2[a]);
                      return 0;
                  }
                  a++;
              break;
              }
          }   
              
          if (selection == 2)
          {
              long int bin, hex = 0, i = 1, left;
              printf(&quot;Enter Binary Number: \n&quot;);
              scanf(&quot;%ld&quot;, &amp;bin);
              while (bin != 0)
              {
                  left = bin % 10;
                  hex = hex + left * i;
                  i = i * 2;
                  bin = bin / 10;
              }
              printf(&quot;Hexadecimal value: %lX&quot;, hex);
          }
          printf(&quot;\nContinue(Y/N)?\n&quot;);
          scanf(&quot;%s&quot;, &amp;answer);
          if (answer=='Y'||answer=='y')
              {
                  again = again +2;
              }
              else
              {
                  again=1;
              }
          }
      }
      printf(&quot;Exit&quot;);
      return 0;
      
  }
  </code></pre>
  <p>I keep getting a syntax error and cannot find where i am not completing the loop. my program is to query for what to convert to then after it converts asks the user if they want to do it again and if yes, present option menu again.</p>
  <p>Can someone tell me where i am going wrong?</p>