title: Calling a function in main
body: <p>I'm just learning <em>C++</em> and I have a little code here:</p>
  
  <pre><code>using namespace std;
  
  int main()
  {
      cout&lt;&lt;"This program will calculate the weight of any mass on the moon\n";
  
      double moon_g();
  
  }
  
  double moon_g (double a, double b)
  {
      cout&lt;&lt;"Enter the mass in kilograms. Use decimal point for any number entered";
      cin&gt;&gt;a;
      b=(17*9.8)/100;
      double mg=a*b;
      return mg;
  }
  </code></pre>
  
  <p>It compiles, but when I run it it only prints out:</p>
  
  <blockquote>
    <p><code>This program will calculate the weight of any mass on the moon</code></p>
  </blockquote>
  
  <p>but doesn't execute the <code>moon_g</code> function.</p>