Horje
Types of Triangles Based on Angles in c++ Code Example
Types of Triangles Based on Angles in c++
#include<iostream>
using namespace std;

int Triangle(int ang1, int ang2, int ang3);

int main()
{
	int ang1, ang2, ang3;

	cout << "Enter Angle 1: ";
	cin >> ang1;

	cout << "Enter Angle 2: ";
	cin >> ang2;

	cout << "Enter Angle 3: ";
	cin >> ang3;

	int sum = Triangle(ang1, ang2, ang3);

	//check
	if ((ang1 < 90 && ang2 < 90 && ang3 < 90) && (sum = 180))
		cout << "Acute Triangle." << endl;
	else if ((ang1 == 90 || ang2 == 90 || ang3 == 90) && (sum = 180))
		cout << "Right Triangle." << endl;
	else
		cout << "Obtuse Triangle." << endl;


	return 0;
}
//
int Triangle(int ang1, int ang2, int ang3)
{
	return (ang1 + ang2 + ang3);
}




Cpp

Related
c++ check if cin got the wrong type Code Example c++ check if cin got the wrong type Code Example
cplusplus Code Example cplusplus Code Example
how to make c++ read strlen Code Example how to make c++ read strlen Code Example
c++ Greatest common divisor Code Example c++ Greatest common divisor Code Example
Remove Linked List Elements leetcode Code Example Remove Linked List Elements leetcode Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11