TOPIC

C - Presentation Error Where ?

vfmilagre asked 3 years ago

include

include

int main() {

double x1, x2, y1, y2, distance;
scanf("%lf %lf",&x1,&y1);
scanf("%lf %lf",&x2,&y2);
distance = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
printf("\n%.4lf", distance);

return 0;

}

Where is the presentation error in here ?

Remember not post solutions. Your post may be reviewed by our moderators.

  • Spider_Hunter replied 2 years ago

    distance=sqrt((x2-x1)(x2-x1)+(y2-y1)(y2-y1));

    try it. will be run program

  • RodolfoCouto replied 2 years ago

    distancia = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));

  • EsraelSousa-IFCE_TIANGUA replied 3 years ago

    O correto é:

    printf("%.4lf\n", distance);