forked from I-RoshanKumar/Beginner_Hactoberfest2022
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLargest.java
More file actions
28 lines (24 loc) · 714 Bytes
/
Largest.java
File metadata and controls
28 lines (24 loc) · 714 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
import java.util.Scanner;
public class Largest {
private static Scanner sc;
public static void main(String[] args) {
int x, y, z;
sc = new Scanner(System.in);
System.out.println("\n Please Enter three Different Value: ");
x = sc.nextInt();
y = sc.nextInt();
z = sc.nextInt();
if (x > y && x > z) {
System.out.format("\n% d is Greater Than both %d and %d", x, y, z);
}
else if (y > x && y > z) {
System.out.format("\n% d is Greater Than both %d and %d", y, x, z);
}
else if (z > x && z > y) {
System.out.format("\n% d is Greater Than both %d and %d", z, x, y);
}
else {
System.out.println("\n Either any two values or all the three values are equal");
}
}
}