Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

. Write a C++ program to calculate area of a Triangle

#include<iostream>
using namespace std;
int main()
{
    float b, h, area;
    cout<<"Enter Base length of Triangle: ";
    cin>>b;
    cout<<"Enter Height length of Triangle: ";
    cin>>h;
    area = 0.5*b*h;
    cout<<"
Area = "<<area;
    cout<<endl;
    return 0;
}
Source by codescracker.com #
 
PREVIOUS NEXT
Tagged: #Write #program #calculate #area #Triangle
ADD COMMENT
Topic
Name
8+9 =