-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample_2_11.java
More file actions
30 lines (27 loc) · 862 Bytes
/
Example_2_11.java
File metadata and controls
30 lines (27 loc) · 862 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
package unit_02.Examples.Example_11;
import java.util.Scanner;
public class Example_2_11 {
static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
int num1 , num2 , num3;
System.out.println("Enter first number: ");
num1 = scanner.nextInt();
System.out.println("Enter second number: ");
num2 = scanner.nextInt();
System.out.println("Enter third number: ");
num3 = scanner.nextInt();
scanner.close();
MaxNum(num1, num2, num3);
}
public static void MaxNum(int x , int y , int z){
int max = x;
if(y > x){
max = y;
}
if (z > max) {
max = z;
}
System.out.println("Max Number: " + max);
System.out.println("x = " + x + ", y = " + y + ", z = " + z);
}
}