WAP to input angle of Triangle and check whether triangle is valid or not
C
Program to Check Whether a Triangle is Valid or Not given Angles of Triangle
·
Write a C program to read three angles of a triangle and check
whether a triangle valid or not.
Required
Knowledge
·
C
printf and scanf functions
·
If Else statement in
C
A triangle is a valid triangle, If and only If the
sum of all internal angles is equal to 180. This is known as angle sum
property of triangle. We will use this triangle property to check whether three
given angles can form a valid triangle.
C
program to check whether a triangle is valid, given angles of triangle
|
Output
Enter Three Angles of a Triangle
30 60 90
It is a Valid Triangle
Enter Three Angles of a Triangle
60 70 80
It is an invalid Triangle
Comments
Post a Comment