Answer:
#include <stdio.h>
#include <math.h>
int main(){
float x1,x2,y1,y2,distance;
printf("x1: "); scanf("%f", &x1);
printf("y1: "); scanf("%f", &y1);
printf("x2: "); scanf("%f", &x2);
printf("y2: "); scanf("%f", &y2);
distance = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
printf("Distance: %f", distance);
return 0;
}
Step-by-step explanation:
This line declares all required variable (i.e. the coordinates and the distance)
float x1,x2,y1,y2,distance;
The next four line prompt and get input for the coordinates
printf("x1: "); scanf("%f", &x1);
printf("y1: "); scanf("%f", &y1);
printf("x2: "); scanf("%f", &x2);
printf("y2: "); scanf("%f", &y2);
This calculates the distance
distance = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
This prints the calculated distance
printf("Distance: %f", distance);
See attachment for sample runs