title: C++ help! Program won't work
body: <p>I've working on writing a program that calculate the hypotenuse of the triangle but somehow, I've come facing some unexpected error or more like runtime error and the sad part is that, I don't even know my own mistake. Anyway, here is my code and I will be  pleased for the answer</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  //function prototype
  double hypotenuse(double leg1, double leg2);
  double leg(double hypotenuse, double leg);
  
  void main()
  {
      //local variable 
      double leg1;
      double leg2;
  
      //user interface
      cout &lt;&lt; "Enter the first leg of the triangle: ";
      cin &gt;&gt; leg1;
      cout &lt;&lt; "Enter the second leg of the triangle: ";
      cin &gt;&gt; leg2;
      cout &lt;&lt; "The value of hypothesis is: " &lt;&lt; hypotenuse(leg1,leg2) &lt;&lt; endl;
  
      system("pause");
  }
  
  double hypothenuse(double leg1, double leg2)
  {
      return ((leg1 * leg1) + (leg2 * leg2));
  }
  </code></pre>