-
Notifications
You must be signed in to change notification settings - Fork 0
/
selection2Exp218.java
35 lines (25 loc) · 1.01 KB
/
selection2Exp218.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.util.Scanner;
public class selection2Exp218 {
public static void main(String[] args) {
Scanner input18 = new Scanner(System.in);
int angle1, angle2, angle3, totalAngle;
System.out.println("enter for angle 1 : ");
angle1 = input18.nextInt();
System.out.println("enter for angle 2 : ");
angle2 = input18.nextInt();
System.out.println("enter for angle 3 : ");
angle3 = input18.nextInt();
totalAngle = angle1 + angle2 + angle3;
if (totalAngle == 180 ) {
if (angle1 == 90 || angle2 == 90 || angle3 == 90) {
System.out.println("right triangle");
} else if (angle1 == angle2 && angle1 == angle3) {
System.out.println("equilateral triangle");
} else if (angle1 == angle2 || angle1 == angle3 || angle2 == angle3) {
System.out.println("isosceles triangle");
}
} else {
System.out.println("not a triangle");
}
}
}