write a C plus plus program to accept three sides of a triangle and check it forms a triangle or not if it forms a triangle then what type of triangle it is. I WILL SURELY MARK U AS THE BRAINLIEST IF YOU WILL ANSWER . AND FOLLOW YOU
Answers
Answer:
Old method:
#include <iostream.h>
#include <conio.h>
void main()
{
int a,b,c = 0;
cout << "Enter the sides of a triangle";
cin >> a >> b >> c;// using to take multiple inputs
if(a + b > c && b + c > a && a + c > b)
{
cout << " Triangle is possible";
if (a == b && b == c)
cout << " Equilateral triangle ";
else if(a == b || b == c || a == c)
cout << " Isosceles triangle ";
else
cout << " Scalene triangle ";
}
else
cout << " Triangle is not possible";
getch();
}
New Method:
#include <iostream>
using namespace std;
int main()
{
int a,b,c = 0;
cout << "Enter the sides of a triangle";
cin >> a >> b >> c;// using to take multiple inputs
if(a + b > c && b + c > a && a + c > b)
{
cout << " Triangle is possible";
if (a == b && b == c)
cout << " Equilateral triangle ";
else if(a == b || b == c || a == c)
cout << " Isosceles triangle ";
else
cout << " Scalene triangle ";
}
else
cout << " Triangle is not possible";
return 0;
}