If the three facets of a triangle are entered via the keyboard, write a program to test whether the triangle is valid or not. The triangle is legitimate if the sum of two aspects is greater than the largest of the three sides. If the three facets of a triangle are entered via the keyboard, write a software to take a look at whether the triangle is isosceles, equilateral, scalene or right angled triangle.
#include <iostream>
using namespace std;
int main()
{
float a, b, c;
cout<< "enter base of triangle : " ;
cin>> a;
cout<< "enter altitude of triangle : " ;
cin>> b;
cout<< "enter hypotenuse of triangle : " ;
cin>> c ;
if ( ( a > b && a > c && b + c > a) || ( b > a && b > c && a + c > b ) || ( c > a && c > b && a + b > c ) )
cout<<"triangle is valid";
else
cout<<"triangle is not valid";
return 0;
}
0 comments:
Post a Comment
If You Have Any Problem While Downloading Comment Below