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.c
STDIN
Run
// C program to find all angles of a triangle if two angles are given #include <stdio.h> int main() { int p, q, r; // p, q, and r is all angles of the triangle printf("Enter the two angles of triangle::\n"); scanf("%d%d", &p, &q); // Compute third angle r = 180 - (p + q); // Output printf("\nThird angle of the triangle = %d", r); return 0; }
50 70
Output
Clear
ADVERTISEMENTS