How to write a C Program to find Area Of a Triangle using base and height with an example?.
C Program to find Area Of a Triangle using base and height
This program allows the user to enter the base and height of a triangle, and then finds the area of a triangle using those two values
TIP : The mathematical formula to calculate Area of a triangle using base and height is: Area = (base * height) / 2
/* C Program to find Area Of a Triangle using base and height */ #include<stdio.h> int main() { float base, height, area; printf("\n Please Enter the Base of a Triangle : "); scanf("%f", &base); printf("\n Please Enter the Height of a Triangle : "); scanf("%f", &height); area = (base * height) / 2; printf("\n The Area of a Triangle using Base and Height = %.2f\n", area); return 0; }