https://github.com/letsdeepchat/which-angled-trangled
Which Angled Trangled using java
https://github.com/letsdeepchat/which-angled-trangled
Last synced: 12 months ago
JSON representation
Which Angled Trangled using java
- Host: GitHub
- URL: https://github.com/letsdeepchat/which-angled-trangled
- Owner: letsdeepchat
- Created: 2021-12-05T14:02:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-05T14:03:47.000Z (over 4 years ago)
- Last Synced: 2025-03-12T10:13:13.728Z (about 1 year ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Which-Angled-Trangled
Which Angled Trangled using java
Which angled triangle
Given the 3 sides of a triangle, find out whether it is acute-angled, right-angled, or obtuse-angled.
You need to output 1 for acute, 2 for right-angled, and 3 for an obtuse-angled triangle. You can assume that the input values always form a triangle and are valid integers.
Note:
A triangle is acute-angled, if twice the square of the largest side is less than the sum of squares of all the sides.
A triangle is obtuse-angled, if twice the square of its largest side is greater than the sum of squares of all the sides.
A triangle is right-angled, if twice the square of its largest side is exactly equal to the sum of squares of all the sides.
Input:
3 4 5
Output:
2
Explanation:
Since 2x5x5 is equal to 5x5 + 3x3 + 4x4, So this is a right-angled triangle and hence, the answer is 2.
Input:
3 3 3
Output:
1
Explanation:
Since 2x3x3 is less than 3x3 + 3x3 + 3x3, So this is an acute-angled triangle and hence, the answer is 1