-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlargest.java
More file actions
43 lines (23 loc) · 782 Bytes
/
largest.java
File metadata and controls
43 lines (23 loc) · 782 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
import java.util.Scanner;
public class largest{
public static void main(String[] args) {
System.out.print("Enter first number: ");
Scanner input = new Scanner(System.in);
int First = input.nextInt();
System.out.print("Enter Second number: ");
//Scanner input = new Scanner(System.in);
int Second = input.nextInt();
System.out.print("Enter third number: ");
//Scanner input = new Scanner(System.in);
int Third = input.nextInt();
if(First >= Third && First >= Second){
System.out.println(First);
}
else if(Second >= Third){
System.out.println(Second);
}
else{
System.out.println(Third);
}
}
}