0
Follows the code:
#include <stdio.h>
#include <math.h>
int main()
{
double distancia;
double x1, y1, x2, y2;
scanf("%lf %lf ", &x1, &y1);
scanf("%lf %lf ", &x2, &y2);
distancia = sqrt (((x2 - x1)*(x2 - x1)) + ((y2 - y1)*(y2 - y1)));
printf("%.4lf\n", distancia);
return 0;
}
When executing the program, instead of asking for 4 entries as written in the entry, it asks for 5 and the fifth does not interfere in the final value. What is this last entry and why it occurs?
try to take the spaces from the
scanf("%lf %lf ", &x2, &y2);
– viana
That’s right, thank you.
– Leko