- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindMin.java
More file actions
Latest commit
27 lines (22 loc) · 500 Bytes
/
Copy pathFindMin.java
File metadata and controls
27 lines (22 loc) · 500 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
importjava.util.Scanner;
publicclassFindMin{
publicstaticvoidmain (String[] args){
intnum1, num2, num3, min = 0;
Scannerscan = newScanner (System.in);
System.out.println("Enter three integers: ");
num1 = scan.nextInt();
num2 = scan.nextInt();
num3 = scan.nextInt();
if (num1 < num2)
if (num1 < num3)
min = num1;
else
min = num3;
else
if (num2 < num3)
min = num2;
else
min = num3;
System.out.println("Minimum value: " + min);
}
}