C Program to calculate the area of the triangle

#include<stdio.h>
int main()
{
    float base,height,area;
    printf("Enter the height of the triangle\n");
    scanf("%f",&height);
    printf("Enter the base of the triangle\n");
    scanf("%f",&base);
    area=0.5*base*height;
    printf("\n The area of the triangle is : %f",area);
}

Output:

C Program to calculate the area of the triangle



Comments