title: Simple C Menu Building, Scanf not haulting for input
body: <p>I am trying to make a program that has a menu system where users can select an option, input the desired number and then perform some operation (in this case, bit shifting) and then return to the menu... However, upon testing this code so far here is the output:</p>
  
  <pre><code>                 Main Menu    
                  ---------    
  1. Perform Left Bit Shift Operation (one value)
  2. Perform Right Bit Shift Operation (one value)
  3. Perform Binary AND Operation (two values)
  4. Perform Binary OR Operation (two values)
  5. Perform Binary One's Complement (~) Operation (one value)
  6. Perform Binary XOR Operation (two values)
  7. Quit 
  1
  
  
  Entered Integer: 0
  Left Shifted: 0
  </code></pre>
  
  <p>It completely skips over my next two scanf statements and just prints what I initialized the values to be. What is causing this issue? Also, what would be the easiest way to display an integer represented as a bit? What I would like to have showbit(int inttobit) do is accept an integer and print its binary representation (with 32 place holders):
  EX: 1234 = 00000000000000000000010011010010
  Anyway, here is my current code below:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  
  void leftShift(int bit, int shift);
  void showBits(int inttobit);
  
  int main(void)
  {
    int option;
    int value1=0,value2=0;
  
    while (option != 7)
      {
        printf("\n");
        printf("                Main Menu    \n ");
        printf("               ---------    \n");
        printf("1. Perform Left Bit Shift Operation (one value)\n");
        printf("2. Perform Right Bit Shift Operation (one value)\n");
        printf("3. Perform Binary AND Operation (two values)\n");
        printf("4. Perform Binary OR Operation (two values)\n");
        printf("5. Perform Binary One's Complement (~) Operation (one value)\n");
        printf("6. Perform Binary XOR Operation (two values)\n");
        printf("7. Quit \n");
  
        scanf("%d",&amp;option);
  
        if (option == 1)
          {
            scanf("Enter a base 10 Integer: %d ", &amp;value1);
            printf("\n");
            scanf("Enter number of places to shift bit: %d", &amp;value2);
            printf("\n");
            leftShift(value1, value2);
          }
        else if (option == 7)
          {
          break; /* break out of loop */
          }
        else if (option &lt; 0 || option &gt; 9)
          {
            printf("Not an option... out of bounds\n");
          }
          }
        return(0);
  }
  
  void showBits(int inttobit)
  {
    printf("\n");
    printf("Integer entered: %d\n", inttobit);
    printf("\n");
  }
  void leftShift(int bit, int shift)
  {
    printf("Entered Integer: %d\n", bit);
    printf("Left Shifted: %d\n", shift);
  }
  </code></pre>
  
  <p>Any help or direction is greatly appreciated!</p>