-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriangle.java
More file actions
29 lines (24 loc) · 815 Bytes
/
Triangle.java
File metadata and controls
29 lines (24 loc) · 815 Bytes
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
import java.util.Scanner;
public class Triangle {
static void triangleType(int a, int b, int c) {
if ((a + b < c) || (a + c < b) || (b + c < a)) {
System.out.println("Triangle not Possible.");
}
if (a == b && b == c) {
System.out.println("Triangle is Equilateral.");
} else if (a == b || c == a || b == c) {
System.out.println("Triangle is Isoceles");
} else {
System.out.println("Triangle is Scaline");
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter 3 Sides of a triangle");
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
triangleType(a, b, c);
sc.close();
}
}