As homework we were assigned to enter the following code to calculate the distance between two points on the x and y plane. The program should ask the user to enter two points then should calculate the distance between two points and print the distance on the screen.
My program will compile correctly but when attempting to run the actual program it doesnt do anything and some how completely skips over my main function...
Any help or corrections will be greatly appriciated!!!!
void enter_a_point ( struct point pc );
float distance (struct point p1, struct point p2);
int main (void)
struct point pt1, pt2 ;
enter_a_point( pt1 ); //get x & y values for pt1
enter_a_point( pt2 ); //get x & y values for pt2
distance ( pt1, pt2);
printf( "Distance between the points = %.2f\n", distance(pt1, pt2) );
void enter_a_point ( struct point pc )
printf( " Enter X value for point\n");
scanf( "%f",&pc.x );
printf( " Enter Y value for point\n");
float distance (struct point p1, struct point p2)
d = sqrtf( powf((p2.x-p1.x),2)+ pow((p2.y-p1.y),2) );