.. www.engineerscur.blogspot.com: C language program to find area of circle from given points

C language program to find area of circle from given points

//with given points area of circle

#include<stdio.h>
#include<conio.h>
#define pi 3.1428
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 area 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("area is %f",n*n*pi);
            printf(“perimeter is:-2*pi*n”);

            getch();
}