Enter three angles & check if it is a triangle - C
C program to read three angles of triangle and check if it forms triangle or not.
Solution:
This program accepts three angles of a triangle from the user and check whether it forms a triangle or not.
Condition for checking whether angles forms triangle or not:
Addition of three angles of triangle equals to(==) 180.
#include<stdio.h>
int main()
{
int a1,a2,a3;
printf("Enter Three Angles of Triangle:\n");
scanf("%d %d %d",&a1,&a2,&a3);
if(a1+a2+a3==180)
printf("\nTriangle Formed");
else
printf("\nTriangle NOT Formed");
return 0;
}
Output:
