title: Calling a function with an if statement in C
body: <p>I have a program that works out the reduced mass of a molecule, and want to call that with an if function. This is the code I have at the moment:</p>
  
  <pre><code>int program ();
  int main()
  {
      printf("Press 1 to calculate the reduced mass of a molecule or press any other button to exit:");
      scanf ("%lg",&amp;repeat);
  
      if(repeat==1)
      {
      program();
      }
      else
      {
      return(0);
      }
  }
  
  int program ()
  //etc...
  </code></pre>
  
  <p>I'm not too experienced with C, so an explanation might be useful. Also would this make it so that you can repeat the function as many times as you like?</p>