Sample Run 1:
Enter the measurement of the sides of the triangle: 3 4 5
The triangle is an example of scalene triangle.
Sample Run 2:
Enter the measurement of the sides of the triangle: 10 10 8
The triangle is an example of isosceles triangle.
Sample Run 3:
Enter the measurement of the sides of the triangle: 10 10 10
The triangle is an example of equilateral triangle.
Sample Run 4:
Enter the measurement of the sides of the triangle: 10 1 2
The triangle is an example of notriangle triangle.
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"Enter The Value Of a,b,c \n";//side's of triangle
cin>>a>>b>>c;
if(a==1 || b==1 || c==1)
{
cout<<"The Triangle is an example of notriangle triangle\n";
}
else if(a==b && b==c && c==a)
{
cout<<"The Triangle is an example of Equilateral\n";
}
else if(a==b || b==c || c==a)
{
cout<<"The Triangle is an example of Isosceles\n";
}
else if(a*a==b*b+c*c ||b*b==c*c+a*a || c*c==a*a+b*b)
{
cout<<"The Triangle is an example of Right angled\n";
}
else
{
cout<<"The Triangle is an example of Scalene angled\n";
}
return 0;
}
Comments
Leave a comment