-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgreatest.java
More file actions
27 lines (21 loc) · 836 Bytes
/
greatest.java
File metadata and controls
27 lines (21 loc) · 836 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
import java.util.Scanner;
public class greatest {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("Greatest of the three numbers");
int num1= input.nextInt();
int num2= input.nextInt();
int num3= input.nextInt();
System.out.println("Enter the number num1 ");
System.out.println("Enter the number num2 ");
System.out.println("Enter the number num3 ");
if (num1 >num2 && num1>num3){
System.out.println("The Greatest number is num1 "+num1);
}else if(num2>num1 && num2>num3){
System.out.println("The Greatest number is num2 "+num2);
}
else {
System.out.println("The Greatest number is num3 "+num3);
}
}
}