Area of Triangle in C++ - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Friday, June 12, 2020

Area of Triangle in C++


C++ PROGRAM TO FIND THE AREA OF TRIANGLE

Sample Test Case    :    Enter height and breadth  : 5  2

Sample Test Case    :    Area of Triangle : 5.0


CODE

#include <iostream>
using namespace std;
int main() 
{
    float a,b,area;
    cout<<"Enter height and breadth :";
    cin>>a>>b;
    area=0.5*a*b;
    cout<<"Area of Triangle :"<<area;
    return 0;
}

No comments:

Post a Comment