20. C Program To find Area of Triangle using B and H values.
How does this program work?
- In this program you are going to learn about How to find out the Area of triangle using C language.
- Take User inputs for base and Height values for the given Triangle.
- And Store them in variables to find out the final answer and display it using C language.
Here is the code
#include <stdio.h>
int main(void)
{
int b,h,area;
printf("Enter base and height of triangle\n");
scanf("%d%d",&b,&h);
area=(b*h)/2; //Formula for area of triangle
printf("Area of the triangle is %d ",area);
return 0;
}