title: interactive menu with switch statement
body: <p>Hi I'm trying to make an interactive menu with switch statement in C.
  Though I'm unsure of how to trigger a function that has certain arguments.
  I'm a total beginner and I'm stumped how to do this.
  The function in the switch statement needs the arguments though I would like the function to ask for the numbers. I'm doing this as an assignment and cannot provide the actual code so I made this mock up. Thank you for your help.</p>
  
  <p>Here is an example of code I might use.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void printMenu()
  {
      int choice;
  
      do
      {
          printf("Main Menu:\n");
          printf("1) do this\n");
          scanf("%d", &amp;choice);
  
          switch (choice)
          {
              case 1:
                  function(); /* though this needs the arguments */
                  break;
          }
      } while (choice != 7);
  
      int main(void)
      {
          printMenu();
          return 0;
      }
  
      void function(int number1, float number2)
      {
          /*calculation*/
          printf("enter your numbers");
          /* Not sure how to read the numbers in here */
          printf("%d + %d = %d", number1, number2, number1 + number2);
          return;
      }
  </code></pre>