-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriangleShape.java
More file actions
43 lines (42 loc) · 883 Bytes
/
Copy pathTriangleShape.java
File metadata and controls
43 lines (42 loc) · 883 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Q11. Triangle Shape (Easy)
Check whether a triangle is Equilateral, Isosceles, or Scalene.
Input format :
Sides of the triangle in separate lines.
Output format :
Type of triangle.
Sample test cases :
Input :
18
18
18
Output :
Equilateral Triangle
Input :
12
25
15
Output :
Scalene Triangle
Input :
52
52
323
Output :
Isosceles Triangle
*/
package week1;
import java.util.Scanner;
public class TriangleShape {
static void eq(int a, int b, int c) {
if(a==b && a ==c && b==c) System.out.println("Equilateral Triangle");
if(a==b || b==c || a==c) System.out.println("Scalene Triangle");
if(a !=b && a!=c && b!=c) System.out.println("Isosceles Triangle");
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
eq(a, b, c);
sc.close();
}
}