C++ Program to Calculate Area of a Triangle



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



  1. //C++ Program to Calculate area of a triangle"
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. float b, h, area;
  7. cout<<"Enter base: ";
  8. cin>>b;
  9. cout<<"Enter height: ";
  10. cin>>h;
  11. area= (b*h)/2;
  12. cout<<"Area = "<< area;
  13. return 0;
  14. }

Output
Output!
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]


Join Our Facebook Group


Share this example


Download Android App

download android app

Popular C++ Examples









codesadda.com

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