Centre Coordinate in C

In this C programming tutorial, we will learn how to find center Coordinate in C programming language. This C Program read the x and y coordinates of the vertex and also read a Length of a side.

C PROGRAM TO DETERMINE THE CENTRE COORDINATE IN C PROGRAMMING LANGUAGE

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

In the above C program, we learned how to find the center of a triangle using the C programming language.

Leave a Reply

Shopping cart