luc012.c (804B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* Write a program to check whether a triangle is valid or not, 8 if three angles of the triangle are entered through the keyboard. 9 A triangle is valid if the sum of all the three angles is equal to 180 degrees. */ 10 /* Let Us C, Chap- 3, Page - 53, Qn No.: f(c) */ 11 12 #include <stdio.h> 13 int main() 14 { 15 double angle1, angle2, angle3, sum; 16 printf("Enter the value of the three angle of the triangle : "); 17 scanf("%lf %lf %lf", &angle1, &angle2, &angle3); 18 sum = angle1 + angle2 + angle3; 19 if (sum == 180.0) 20 printf("\nThis Triangle is a valid one."); 21 else 22 printf("\nThis Triangle is not valid. Sum of the angles : %g", sum); 23 return 0; 24 }