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. }

download android app

Popular C Examples


Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube