C++ Online Compiler
Example: C++ program to find all angles of a triangle if two angles are given
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program to find all angles of a triangle if two angles are given #include <iostream> using namespace std; int main() { int p, q, r; // p, q, and r is all angles of the triangle cout << "Enter the two angles of triangle::\n"; cin >> p >> q; // Compute third angle r = 180 - (p + q); // Output cout << "\nThird angle of the triangle = " << r; return 0; }
50 70
Output
Clear
ADVERTISEMENTS