#include<iostream.h>
#include<conio.h>
#include<math.h>
float Distance(int , int , int , int);
void main()
{
clrscr();
int cx1, cy1, cx2, cy2;
float result;
cout<<"Enter coordinates of first point: ";
cin>>cx1>>cy1;
cout<<"Enter coordinates of second point: ";
cin>>cx2>>cy2;
reult = Distance (cx1, cy1,cx2,cy2);
cout<<"The distance between given point is : "<<result;
getch();
}
float Distance(int x1,int y1, int x2, int y2)
{
return sqrt(pow(x2-x1),2)+pow((y2-y1),2));
}
#include<conio.h>
#include<math.h>
float Distance(int , int , int , int);
void main()
{
clrscr();
int cx1, cy1, cx2, cy2;
float result;
cout<<"Enter coordinates of first point: ";
cin>>cx1>>cy1;
cout<<"Enter coordinates of second point: ";
cin>>cx2>>cy2;
reult = Distance (cx1, cy1,cx2,cy2);
cout<<"The distance between given point is : "<<result;
getch();
}
float Distance(int x1,int y1, int x2, int y2)
{
return sqrt(pow(x2-x1),2)+pow((y2-y1),2));
}
0 comments:
Post a Comment