Computer Science, asked by Rudranil420, 9 months ago

Write a program in C++ to input any three angles and to print whether a triangle is possible with those angles or not.​

Answers

Answered by ıtʑFᴇᴇʟɓᴇãᴛ
39

\mathtt{\huge{\underline{\red{Question\:?}}}}

✴ Write a program in C++ to input any three angles and to print whether a triangle is possible with those angles or not.

\mathtt{\huge{\underline{\green{Answer:-}}}}

✴ A program in C++ to input any three angles and to print whether a triangle

\mathcal{\huge{\fbox{\fbox{\orange{Programme:-}}}}}

///

{/**

* 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.

_____________________________________

Answered by Yashicaruthvik
1

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

Similar questions