81.7k views
5 votes
Write a programme to input the values of two angle and find out the third angle of a triangle​

User Sakabako
by
5.9k points

1 Answer

1 vote

Answer:#include <stdio.h>

int main()

{

int ang1, ang2, ang3; /*are three angles of a triangle */

/* Read two angles of the triangle from user separated by comma*/

printf("Input two angles of triangle separated by comma : ");

scanf("%d, %d", &ang1, &ang2);

ang3 = 180 - (ang1 + ang2); /* Calculates the third angle */

printf("Third angle of the triangle : %d\\", ang3);

return 0;

}

User Dewal Tewari
by
4.5k points