78 439
Assignments Done
Successfully Done
In September 2019

Answer to Question #26723 in C++ for santosh

Question #26723
write a program in c++ to find out the area of a right angle triangle
Expert's answer
#include <iostream>

int main()
//show message and enter first leg of triangle
std::cout <<"Enter first leg of right triangle\n";
float a=0;
std::cin >>a;

//show message and enter second leg of triangle
std::cout <<"Enter second leg of right triangle\n";
float b=0;
std::cin >>b;

float area=0;
//if input correct then calculate an area else show error message
if( ( a>0 ) && (b>0) )
std::cout <<"Area=" <<area <<"\n";
std::cout <<"Input error!\n";

return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions