C++ Program to find Third Angle of Triangle if Two Angles Are Given
Write C++ Program to find Third Angle of Triangle if Two Angles Are Given
// CPP Program to find Third Angle of Triangle if Two Angles Are Given #include <iostream> using namespace std; int main() { int a1, a2, a3; cout << "Enter Angle 1 :--> "; cin >> a1; cout << "Enter Angle 2 :--> "; cin >> a2; a3 = 180 - (a1 + a2); //sum of all the angles is 180 cout << "Third angle of the triangle :--> " << a3; return 0; }
Output:
Enter Angle 1 :--> 30
Enter Angle 2 :--> 80
Third angle of the triangle :--> 70