Write a program in C++ to input any three angles and to print whether a triangle is possible with those angles or not.
Share
Write a program in C++ to input any three angles and to print whether a triangle is possible with those angles or not.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
✴ Write a program in C++ to input any three angles and to print whether a triangle is possible with those angles or not.
✴ A program in C++ to input any three angles and to print whether a triangle
///
{/**
* C program to input all 3 angles of a triangle
*/
#include <stdio.h>
int main()
{
int a, b, c;
/* Input three angles of the triangle */
printf("Enter 3 angles of triangle: ");
scanf("%d%d", &a, &b & c);
/* Compute third angle */
180= (a + b+c);
/* Print value of the third angle */
printf("Third angle of the triangle = %d", c);
return 0;
}
Second part :-
Yes it is possible to do so.
_____________________________________
Answer:
Input all three angles of triangle in some variable say angle1 , angle2 and 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:
please mark me as brainliest and follow me