#include #include int main() { double x0, y0, x1, y1, x2, y2, dist01, dist02, dist12; extern double dist(double x0, double y0, double x1, double y1); printf("Enter x and y values for point #0: "); scanf("%lg%lg", &x0, &y0); printf("Enter x and y values for point #1: "); scanf("%lg%lg", &x1, &y1); printf("Enter x and y values for point #2: "); scanf("%lg%lg", &x2, &y2); dist01 = dist(x0, y0, x1, y1); dist02 = dist(x0, y0, x2, y2); dist12 = dist(x1, y1, x2, y2); if (dist01 < dist02 && dist01 < dist12) printf("Points 0 and 1 are closest together\n"); else if (dist02 < dist12) printf("Points 0 and 2 are closest together\n"); else printf("Points 1 and 2 are closest together\n"); return 0; } double dist(double x0, double y0, double x1, double y1) { return sqrt((x0-x1) * (x0-x1) + (y0-y1) * (y0-y1)); }