Computer Science, asked by anujabhadane253, 1 month ago

Write algorithm accept the X and Y coordinate of two points and compute the distance between the two points

Answers

Answered by drarsalan34
0

sorry i dont now answer

anybody please give answer to him

Answered by lightningmonster1548
0

Answer: C program :

#include <stdio.h>

#include <math.h>

main()

{

        float x1,y1,x2,y2,distance;

        printf("Enter the coordinates of first point\n");

        scanf("%f%f",&x1,&y1);

        printf("Enter the coordinates of second point\n");

        scanf("%f%f",&x2,&y2);

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

        printf("The distance between two points : %f\n",distance);

}

Explanation:

Output :

Enter the coordinates of first point

4 3

Enter the coordinates of second point

1 1

The distance between two points : 3.605551

Similar questions