I need help for a class where I have to make a program that calculates the square of distance between two points in the xy axis (x1,y1) and (x2,y2)
For the most part the program can calculate out the answer. My only problem is that I need the program to STATE "The square of the distance between (x1,y1) and (x2,y2) is Z, where Z is the answer. Right now when I attempt to compile the program, it tells me the line with [ printf("The square of the distance between (%lf,%lf) and (%lf,%lf) is %lf", x1, y1, x2, y2);] has too few arguments for format. Can someone help me fix the error in the code? This is the first real program i'm writing so I am pretty lost.
Code:
#include <stdio.h>
int main()
{
double x1, x2, y1, y2, z;
printf("Enter the value of x1: ");
scanf("%lf", &x1);
printf("Enter the value of y1: ");
scanf("%lf", &y1);
printf("Enter the value of x2: ");
scanf("%lf", &x2);
printf("Enter the value of y2: ");
scanf("%lf", &y2);
z = ((x2 - x1) * (x2 -x1)) + ((y2 - y1) * (y2 - y1)) ;
printf("The square of the distance between (%lf,%lf) and (%lf,%lf) is %lf", x1, y1, x2, y2);
return 0;
}