You are on page 1of 1

1 #include<stdio.

h>
2 #include<math.h>
3
4 float f(float x1,float y1,float x2,float y2){
5 float DBTwoPoints;
6 DBTwoPoints=sqrt(pow((x2-x1),2)+pow((y2-y1),2));
7
8 return DBTwoPoints;
9 }
10 int main(){
11
12 float x1, y1, x2, y2,DBTwoPoints;
13 printf("enter 1st coordinate values\n",x1,y1);
14 scanf("%f%f",&x1,&y1);
15 printf("enter 2nd coordinate values\n",x2,y2);
16 scanf("%f%f",&x2,&y2);
17 DBTwoPoints=f(x1, y1, x2, y2);
18
19 printf("distance btwn 2 entered points is %f\n",DBTwoPoints);
20
21 return 0;}
22

You might also like