exception handling in C++
<p>i have the following program using exception handling.</p>

<pre><code>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;

void divide(int x,int y,int z)
{
  cout&lt;&lt;"\n Inside function 1 \n";

  if((x-y)!=0)
  {
    int R=z/(x-y);
    cout &lt;&lt; "Result =" &lt;&lt; R&lt;&lt;"\n";
  } // end of if
  else
  {
    throw(x-y);
  }  // end of else
}   // end of void

int main()
{
  try
  {
    cout&lt;&lt; "Inside try block\n";
    divide(10,20,30);
    divide(10,10,20);
  } //end of try
  catch(int i)
  {
    cout&lt;&lt; "Caught\n";
  }
  return 0;
} //end of main
</code></pre>

<p>When compiling i get the following errors</p>

<p>Function throw should have  a prototype.</p>

<p>Undefined symbol "try"</p>

<p>Statement missing ;</p>

<p>Function should return a value.</p>

<p>Please help me.Thanks a lot</p>
