heres the code. thanks in advance for the help!

#include <stdio.h> #include <math.h> #define READFILE "points5.txt" #define WRITEFILE "points5.txt" int main() { double x; double y; double xwrite; double ywrite; double distanceSum = 0; double x0 = 0; double y0 = 0; double distance = 0; double count = 0; double avgdistance; FILE *writefile, *readfile; writefile = fopen("points5.txt", "w"); do { printf("Enter X and Y Coordinates (Enter 0 0 to stop): "); scanf("%lf %lf", &xwrite, &ywrite); fprintf(writefile, " %.2f %.2f \n", xwrite, ywrite); }while ( xwrite != 0, ywrite != 0 ); printf(" Point 1 Point 2 Distance\n"); readfile = fopen("points5.txt", "r"); x = 1; y = 1; while(x != 0, y != 0) { fscanf(readfile, " %lf %lf ", &x, &y); // Read X and Y distance = sqrt (((x-x0)*(x-x0)) + ((y-y0)*(y-y0))); // Calculate distance between points printf(" (%5.2f , %5.2f ) (%5.2f , %5.2f ) %8.2f\n", x0, y0, x, y, distance); // display distance between two points and those 2 points x0 = x; // store x as x0 y0 = y; // store y as y0 distanceSum += distance; // calculate total distance traveled count += 1; } avgdistance = distanceSum / count; printf("\nTotal Distance is %9.2f\n", distanceSum); printf("\nThe number of points entered is %4.1f\n", count); printf("\nThe Average Distance Between Points is %9.3f", avgdistance); return 0; }