Area of Triangle in C

The area of a triangle is a fundamental geometric concept in C language we can compute the area of a triangle by using a simple mathematical formula. In this article, we will write a program to find the Area of a triangle.

Area of Triangle Formula

The area of a triangle can be calculated by using the formula-

Area = 1/2* base * height

Here the base represents the length of the triangle’s base and height is the perpendicular distance from the base to the opposite vertix.

C Program for Calculating Area of Triangle

Output

C Program for Calculating Area of Triangle

The above C program asks the user to enter the base and height of the triangle. after that, the program checks whether both base and height are positive values before proceeding with the area calculation. if the input is valid, the C program calculates the area of a triangle and prints the result.

Happy Coding

See Also

1 thought on “Area of Triangle in C”

Leave a Comment