C languageC SolutionChapter 3Programming

Q17 If the three sides of a triangle are entered through the keyboard, write a program to check whether the triangle is valid or not. The triangle is valid if the sum of two sides is greater than the largest of the three sides.

Program: 85

If the three sides of a triangle are entered through the keyboard, write a c program to check whether the triangle is valid or not. The triangle is valid if the sum of two sides is greater than the largest of the three sides.

Output:

Enter the first side of triangle: 2
Enter the second side of triangle: 3
Enter the third side of triangle: 4
Triangle is valid
 Enter the first side of triangle: 4
 Enter the second side of triangle: 2
 Enter the third side of triangle: 1
 Triangle is not valid

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.