Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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);
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: Types of Conversions- C++ 
Cpp :: is obje file binary?? 
Cpp :: A Subtask Problem codechef solution in cpp 
Cpp :: Opengl GLFW basic window 
Cpp :: properties of loop in c++ and how it works 
Cpp :: softwareegg.courses4u 
Cpp :: big o notation practice c++ 
Cpp :: logisch nicht 
Cpp :: c++ program that put a space in between characters 
Cpp :: library management system project in c++ using array 
Cpp :: lru cache gfg 
Cpp :: variadic template constructor matches better than copy constructor 
Cpp :: what does npl mean? 
Cpp :: transform c++ 
Cpp :: distinct numbers cses 
Cpp :: default order in set in c++ 
Cpp :: Runtime error(Exit status:153(File size limit exceeded)) c++ 
Cpp :: For auto map C 
Cpp :: huffman encoding in c++ 
Cpp :: second smallest element using single loop 
Cpp :: generate random ints and floats 
Cpp :: how to add 2 objects using operator overloading in c++ 
Cpp :: c++ unordered set count 
Cpp :: convert preorder to postorder calculator 
Cpp :: 7 9 C:UsersAliyahDocumentsshut up.cpp [Error] expected unqualified-id before string constant 
Cpp :: cplusplus 
Cpp :: How to assign two dimensional initializer list in c++ 
Cpp :: construct string with repeat limit 
Cpp :: Check if two stacks are the same using C++ 
Cpp :: initializer before void c++ 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =