C Program to Calculate Area of a Triangle



To calculate area of a triangle we use the formula area=(base*length)/2



  1. //C Program to Calculate area of a triangle"
  2. #include<stdio.h>
  3. int main()
  4. {
  5. float b, h, area;
  6. printf("Enter base: ");
  7. scanf("%f", &b);
  8. printf("Enter height: ");
  9. scanf("%f", &h);
  10. area= (b*h)/2;
  11. printf("Area = %f", area);
  12. return 0;
  13. }

Output


Output!