#include <stdio.h>
#include <math.h>
typedef struct {
double x;
double y;
}POINT;
double POINTdist(POINT a,POINT b){
double hasil;
hasil=sqrt(pow((b.x-a.x),2)+pow((b.y-a.y),2));
return hasil;
}
int main(){
POINT a,b;
double hasil;
a.x=5;
a.y=10;
b.x=2;
b.y=4;
hasil=POINTdist(a,b);
printf("%.2f",hasil);
return 0;
}
#include <math.h>
typedef struct {
double x;
double y;
}POINT;
double POINTdist(POINT a,POINT b){
double hasil;
hasil=sqrt(pow((b.x-a.x),2)+pow((b.y-a.y),2));
return hasil;
}
int main(){
POINT a,b;
double hasil;
a.x=5;
a.y=10;
b.x=2;
b.y=4;
hasil=POINTdist(a,b);
printf("%.2f",hasil);
return 0;
}
makasih ilmunya
BalasHapussama sama :)
Hapus