Center of a line (when one end coordinates and length is given) program in c

#include<stdio.h>
int main()
{
    int i,j,k;
    printf("Enter the x-coordinate of the vertex\n");
    scanf("%d",&i);
    printf("Enter the y-coordinate of the vertex\n");
    scanf("%d",&j);
    printf("Enter the length of a side\n");
    scanf("%d",&k);
    printf("The centre of line is at (%d,%d)",(i+(k/2)),(j+(k/2)));
    return 0;
}

Leave a Reply