DEV_BUT1/DEV1.1/TP07/distance.c

21 lines
381 B
C
Raw Normal View History

2022-10-18 14:50:36 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void){
double x1;
double x2;
double y1;
double y2;
double res;
printf("Donnez la coordonée 1 : \n");
scanf("%lf", &x1);
scanf("%lf", &y1);
printf("Donnez la coordonée 2 : ");
scanf("%lf", &x2);
scanf("%lf", &y2);
res= sqrt(pow((x1-x2),2)+pow((y1-y2),2));
printf("%lf", res);
return EXIT_SUCCESS;
}