WTF is that page about anyway?? -- FDG
It was probably created to paste code to show people. They forgot the wiki word and didn't leave any comment about the purpose. -- Mike Nolan
#include<stdio.h>
#include<math.h>
double getdistance( double co1, double co2);
main()
{ double x1, x2, y1, y2;
double co1, co2;
double distance;
printf("Enter the cartesian coordinates needed to calculate the distance\n");
scanf("%lf %lf %lf %lf", &x1, &x2, &y1, &y2);
co1 = x1 - x2;
co2 = y1 - y2;
distance = getdistance(co1, co2);
printf("The distance between the coordinates is %.2f\n", distance);
return 0;
}
getdistance( double co1, double co2)
{
return sqrt(co1*co1 + co2*co2);
}
