Answer to Question #296715 in C++ for Norri

Question #296715

Using Enumeration type




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-11T18:33:10-0500
#include<iostream>
using namespace std;


int main()
{
	int x, y, z;
	
	cout << "\nEnter the measurement of the sides of the Triangle :\n ";
	cin >> x>> y >> z;
	
	if(x == y && z == z)
  	{
  		cout << "\nThis is an Equilateral Triangle";
  	}
  	else if(x == y || y == z || x == z)
    {
  		cout << "\nThis is an Isosceles Triangle";
	}
		else if(x || y || z ==1)
    {
  		cout << "\nThis is an Notriangle Triangle";
	}
  	else
    	cout << "\nThis is a Scalene Triangle";
		
 	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