write a program to input three angles of a triangle and check whether a triangle is possible or not.
If possible then check whether it is an acute angled triangle,right angled or an obtuse angled triangle otherwise, display"Triangle not possible".
Sample Input: Enter three angles : 40,50,90
Sample Output: Right angled triangle.
Answers
Answer:
Input all three angles of triangle in some variable say angle1, angle2 and angle3.
Find sum of all three angles, store sum in some variable say sum = angle1 + angle2 + angle3.
Check if(sum == 180) then, triangle can be formed otherwise not. In addition, make sure angles are greater than 0 i.e. check condition for angles if(angle1 > 0 && angle2 > 0 && angle3 > 0).
Explanation:
hiii
Answer:
Input all three angles of triangle in some variable say angle1, angle2 and angle3.
Find sum of all three angles, store sum in some variable say sum = angle1 + angle2 + angle3.
Check if(sum == 180) then, triangle can be formed otherwise not. In addition, make sure angles are greater than 0 i.e. check condition for angles if(angle1 > 0 && angle2 > 0 && angle3 > 0).