.. www.engineerscur.blogspot.com: C language program to find distance between two points

C language program to find distance between two points

//distance bet.n two points
#include<stdio.h>
#include<conio.h>
void main()
{           float x1,y1,x2,y2,i,j,k,l,m,n;
            clrscr();
            printf("line joining the points(x1,y1) and (x2,y2) which lies on the circumference of the circle is the diameter of the circle.\nso, enter the points to find diameter and are of circle.............");
            printf("enter the value of x1:");
            scanf("%f",&x1);
            printf("enter the value of y1:");
            scanf("%f",&y1);
            printf("enter the value of x2:");
            scanf("%f",&x2);
            printf("enter the value of y2:");
            scanf("%f",&y2);
            printf("the points are:(%f,%f) and (%f,%f)",x1,y1,x2,y2);
            i=x1-x2;
            j=y1-y2;
            k=i*i;
            l=j*j;
            m=k+l;
            n=sqrt(m);
            printf("distance is %f",n);
            getch();
}