title: C++ Sqrt function
body: <p>when i compile my program it doesnt seem to execute my formula i cant figure what i am doing wrong help would be appreciated </p>
  
  <pre><code>int main ()
    {
  int distance, Xvalue, Yvalue;
  double x1,y1,x2,y2;
  
  cout &lt;&lt; "\n Please enter X1 value: ";
  cin  &gt;&gt; x1;
  cout &lt;&lt; " Please enter X2 value: ";
  cin  &gt;&gt; x2;
  cout &lt;&lt; "\n Please enter Y1 value: ";
  cin  &gt;&gt; y1;
  cout &lt;&lt; " Please enter Y2 value: ";
  cin  &gt;&gt; y2;
      Xvalue = (x1 - x2);
      Yvalue = (y1 - y2);
  distance = sqrt(Xvalue * Xvalue + Yvalue * Yvalue);
  
  cout &lt;&lt; "This is the distance between the two points" &lt;&lt;distance&lt;&lt; 
  
  
     cout &lt;&lt; endl &lt;&lt; endl;
     system ("pause");
    return 0;
   }
  </code></pre>