Answer to Question #295961 in C++ for Norri

Question #295961

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.

1
Expert's answer
2022-02-10T07:12:44-0500
 #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;


}
 

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog