Midpoint Coordinate of the line in C

To find the Midpoint Coordinate of the line, you can take help of the below C Program. Midpoint Coordinate of the line in C.

Midpoint Coordinate of the line in C

#include<stdio.h>
int main()
{
float x,y;
int x1,x2,y1,y2;
printf("Enter x1\n");
scanf("%d",&x1);
printf("Enter y1\n");
scanf("%d",&y1);
printf("Enter x2\n");
scanf("%d",&x2);
printf("Enter y2\n");
scanf("%d",&y2);
x=(x1+x2);
x=x/2;
y=(y1+y2);
y=y/2;
printf("Mid point of the Line is (%.1f , %.1f)",x,y);
return 0;
}

Leave a Reply

Shopping cart