제곱근을 구하는 함수인 sqrt를 사용해서 구하면 편리합니다. (double로 선언) #include
\n"); scanf("%lf%lf", &x1, &y1); printf("Enter the coordinates of q.\n"); scanf("%lf%lf", &x2, &y2); distance = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)); printf("Distance between the points is %lf.
\n", distance); return 0; } 결과...
원문 링크 : [c언어] 두 점 사이의 거리 구하기