i m having difficulty in executing this code.

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int x1,x2,y1,y2,distance;
cout<<"enter coordinates of the first point:";
cin>>x1>>y1;
cout<<"\nenter coordinates of the second point:";
cin>>x2>>y2;
distance=sqrt(pow((x2-x1),2)-pow((y2-y1),2));
cout<<"\ndistance="<<distance;
getch();
}





keeps getting this error

Function call missing ) in function main()
plz post the corrected code.
Last edited on
The end of this line is missing distance=sqrt(pow((x2-x1),2)-pow((y2-y
Line 1 should be: #include<iostream>
^ it depends on what compiler you're using. However as far as I know all compilers that make you include <iostream.h> are very dated, and it's in your interest to update to a newer one (GCC, and Visual Studio are popular among this forum, and let's not turn this thread into a compiler war).
im using borland c++ 4.5

I'm pretty sure that's about 15 years old, so try updating to something a little more recent like GCC 4.7 or Visual Studio 2010
Topic archived. No new replies allowed.