Triangle Validation
Tom is given an assignment by this teacher. He provides him the length of the sides of a triangle and asks if they form the sides of the triangle.
If yes, the output should be , “Sides form a Triangle”. If not, the output should be “Sides does not form a Triangle”. All the sides should be greater than zero. If any side is less than or equal to zero the output should be “Invalid Input”.
Note : The rule for a triangle is sum of the length of any two sides [taken in any manner] of a triangle should be greater than the length of the third side.
Sample Input 1:
Enter the value for side1
6
Enter the value for side2
4
Enter the value for side3
5
Sample Output 1
Sides form a Triangle
Sample Input 2:
Enter the value for side1
6
Enter the value for side2
12
Enter the value for side3
5
Sample Output 2:
Sides does not form a Triangle
Result Description
![Triangle Validation Tom is given an assignment by this teacher. He provides him the length of the sides of a triangle and asks if they form the sides of the triangle. If yes, the output should be , “Sides form a Triangle”. If not, the output should be “Sides does not form a Triangle”. All the sides should be greater than zero. If any side is less than or equal to zero the output should be “Invalid Input”. Note : The rule for a triangle is sum of the length of any two sides [taken in any manner] of a triangle should be greater than the length of the third side. Sample Input 1: Enter the value for side1 6 Enter the value for side2 4 Enter the value for side3 5 Sample Output 1 Sides form a Triangle Sample Input 2: Enter the value for side1 6 Enter the value for side2 12 Enter the value for side3 5 Sample Output 2: Sides does not form a Triangle Triangle Validation Tom is given an assignment by this teacher. He provides him the length of the sides of a triangle and asks if they form the sides of the triangle. If yes, the output should be , “Sides form a Triangle”. If not, the output should be “Sides does not form a Triangle”. All the sides should be greater than zero. If any side is less than or equal to zero the output should be “Invalid Input”. Note : The rule for a triangle is sum of the length of any two sides [taken in any manner] of a triangle should be greater than the length of the third side. Sample Input 1: Enter the value for side1 6 Enter the value for side2 4 Enter the value for side3 5 Sample Output 1 Sides form a Triangle Sample Input 2: Enter the value for side1 6 Enter the value for side2 12 Enter the value for side3 5 Sample Output 2: Sides does not form a Triangle](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8t_Zcq7AvMni2eTSXMMo-ucfZe7AJXqL8XI0fJ-Knw0ccTh2JYQNKJKp_lm6JJ7fGnUjUxHpx07oPCBZJTgNxeRx3CknRtAT6Bezn9zqXyy5QUpnpIC19GsZVLZIW7I1IiQRFkLYJaxWw/w640-h378/Screenshot+Capture+-+2021-07-10+-+21-15-15.png)
Comments
Post a Comment