- 1

Write a program to store base and hight to triangle than print area

2nd Feb 2021, 2:25 AM
gautam sahu
gautam sahu - avatar
3 Réponses
+ 3
Please show us your attempt so far so we may help. Thanks. Here are some hints: To get the input; int var; cin >> var; Formula for area of a triangle: (base * height) / 2
2nd Feb 2021, 2:26 AM
noteve
noteve - avatar
+ 1
Area = 0.5*base*height
2nd Feb 2021, 5:25 AM
Sonic
Sonic - avatar
0
Hello To calculate area of triangle equation is 05*height*base To get Height and base from user refer following code: cout<<"Enter height: "; cin>>height; cout<<"Enter base: "; cin>>base; area= (0.5)*height*base; to print area use: cout<<"Area of triangle is : "<<area;
4th Feb 2021, 4:16 AM
AjayGohil