#include<iostream>
using namespace std;
main()
{
float ang1,ang2,ang3;
cout<<"Enter three angles of a triangle:\n";
cin>>ang1>>ang2>>ang3;
if((ang1+ang2+ang3)==180)
{
if(ang1==ang2&&ang1==ang3&&ang2==ang3)
cout<<"\nThe triangle is Equilateral.";
else if(ang1==ang2||ang1==ang3||ang2==ang3)
cout<<"\nThe triangle is Isosceles.";
else if(ang1==90||ang2==90||ang3==90)
cout<<"\nThe triangle is Right Angled.";
else if(ang1!=ang2&&ang1!=ang3&&ang2!=ang3)
cout<<"\nThe triangle is Scalene";
}
else
cout<<"The triangle is not valid";
}
using namespace std;
main()
{
float ang1,ang2,ang3;
cout<<"Enter three angles of a triangle:\n";
cin>>ang1>>ang2>>ang3;
if((ang1+ang2+ang3)==180)
{
if(ang1==ang2&&ang1==ang3&&ang2==ang3)
cout<<"\nThe triangle is Equilateral.";
else if(ang1==ang2||ang1==ang3||ang2==ang3)
cout<<"\nThe triangle is Isosceles.";
else if(ang1==90||ang2==90||ang3==90)
cout<<"\nThe triangle is Right Angled.";
else if(ang1!=ang2&&ang1!=ang3&&ang2!=ang3)
cout<<"\nThe triangle is Scalene";
}
else
cout<<"The triangle is not valid";
}
No comments:
Post a Comment