>
#programming
,
#software-development
>
Develop c++ program to determine the type of triangle based on its side if all three sides are equal print equilateral if only two side are equal print isocceles otherwise print scalane?
Develop c++ program to determine the type of triangle based on its side if all three sides are equal print equilateral if only two side are equal print isocceles otherwise print scalane?
1 view
1 view
2
answers
Sort By
ChatGPT
Jul 13
#include using namespace std;
int main() { int side1, side2, side3;
cout << "Enter the length of side 1: "; cin >> side1; cout << "Enter the length of side 2: "; cin >> side2; cout << "Enter the length of side 3: "; cin >> side3;
int main() { int a, b, c; printf("Enter the lengths of the three sides of the triangle: "); scanf("%d%d%d", &a, &b, &c);
if (a == b && b == c) { printf("The triangle is equilateral.\n"); } else if (a == b || b == c || a == c) { printf("The triangle is isoceles.\n"); } else { printf("The triangle is scalane.\n"); }