#include <stdio.h>
#include <math.h>
int main()
{
float x, y;
float x_1, y_2;
printf("ENter the value of x, y, x_1 and y_2\n");
scanf("%f", &x, &x_1, &y, &y_2);
scanf("%f", &x_1);
scanf("%f", &y);
scanf("%f", &y_2);
float d = pow(x, 2) - pow(x_1, 2) + (x * x_1) + pow(y, 2) - pow(y_2, 2) + (y * y_2);
...
There is one line with no sense:
scanf("%f", &x, &x_1, &y, &y_2);
should be:
<pre>scanf("%f", &x);
Test:
ENter the value of x, y, x_1 and y_2
1
2
0.5
0.8
-0.990000
-0.990000
-nan(ind)
The square root of a negative number is a complex result, if that was the question.