Answer:
#include<iostream>
using namespace std;
int main(){
//initialize
int a, b,c;
//print the message
cout<<"Enter the three sides of the triangle: "<<endl;
//store in the variables
cin>>a>>b>>c;
//if-else statement for checking the conditions
if(a == b && b == c && a == c){
cout<<"\nThe triangle is equilateral";
}else if(a != b && b != c && a != c ){
cout<<"\nThe triangle is scalene";
}else{
cout<<"\nThe triangle is isosceles";
}
return 0;
}
Explanation:
Create the main function and declare the three variables for the length of the sides of the triangle.
print the message on the screen for the user. Then the user enters the values and its store in the variables a, b, and c.
use the if-else statement for checking the conditions.
Equilateral triangle: all sides of the triangle are equal.
if condition true, print the equilateral triangle.
Scalene triangle: all sides of the triangle are not equal.
if condition true, print the Scalene triangle.
if both conditions is not true, then, the program moves to else part and print isosceles.