How to write a C Program to find Angles of a Triangle if two angles given with an example?.
C Program to find Angles of a Triangle if two Angles are given
This program allows the user to enter two angles of a triangle and then finds the third angle
TIP : Sum of all angles in a triangle = 180
It means if two angles of a triangle given then the third angle will be 180 – (angle 1 + angle 2)
/* C Program to find Angles of a triangle if two angles are give */ #include<stdio.h> int main() { float a, b, c; printf("\n Please Enter two angles of a triangle \n"); scanf("%f%f",&a,&b); c= 180 - (a + b); printf("\n Third Angle of a Triangle = %.2f\n", c); return 0; }
OUTPUT