Tuesday, 9 January 2018

c++ program that find isosceles triangle equilateral triangle right angle triangle and scalene triangle

#include <iostream>

using namespace std;
main(){
int side1,side2,side3,a,b,c;
cout<<"Enter first side =";
cin>>side1;
cout<<"Enter second side=";
cin>>side2;
cout<<"Enter third side=";
cin>>side3;
if(side1==side2 && side2==side3 && side1==side3)
{

cout<<"isosceles triangle";
}

else if (side1==side2==side3)
{

cout<<"equilateral triangle";
}
else if(c*c==a*a+b*b || b*b==a*a+c*c || a*a==b*b+c*c )
{

cout<<"right angle triangle";
}
else
{

cout<<"scalene triangle";
}


}

No comments:

Post a Comment