Look at this code.
Code:
#include <stdio.h>
#include <math.h>
int main (void) {
int integer, x1, y1, x2, y2;
double distance;
printf( "Enter the x and y coordinates of the first plane.\n");
if(scanf( "%d %d", &x1, &y1) != 2)
return -1;
while(getchar() != '\n');
printf( "Enter the x and y coordinates of the second plane.\n");
if(scanf( "%d %d", &x2, &y2) != 2)
return -1;
while(getchar() != '\n');
distance=sqrt((pow((x2-x1), 2))+(pow((y2-y1), 2)));
printf("The distance is %.2f\n", distance);
return 0;
}
When you compile, be sure to link with the math library (m).