-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChapter.java
More file actions
54 lines (36 loc) · 1.78 KB
/
Chapter.java
File metadata and controls
54 lines (36 loc) · 1.78 KB
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
44
45
46
47
48
49
50
51
52
53
54
import java.util.Scanner;
public class Chapter{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("enter first number: ");
int num1 = input.nextInt();
System.out.print("enter second number: ");
int num2 = input.nextInt();
System.out.print("enter third number: ");
int num3 = input.nextInt();
System.out.print("enter fouth number: ");
int num4 = input.nextInt();
System.out.print("enter fifth number: ");
int num5 = input.nextInt();
if (num1 > num2 && num1 > num3 && num1 > num4 && num1 > num5)
System.out.printf("%d is the largest number in the Group ", num1);
if (num2 > num1 && num2 > num3 && num2 > num4 && num2 > num5)
System.out.printf("%d is the largest number in the Group ", num2);
if (num3 > num2 && num3 > num1 && num3 > num4 && num3 > num5)
System.out.printf("%d is the largest number in the Group ", num3);
if (num4 > num2 && num4 > num3 && num4 > num1 && num4 > num5)
System.out.printf("%d is the largest number in the Group ", num4);
if (num5 > num2 && num5 > num3 && num5 > num4 && num5 > num1)
System.out.printf("%d is the largest number in the Group ", num5);
if (num1 < num2 && num1 < num3 && num1 < num4 && num1 < num5)
System.out.printf("%d is the smallest number in the Group ", num1);
if (num2 < num1 && num2 < num3 && num2 < num4 && num2 < num5)
System.out.printf("%d is the smallest number in the Group ", num2);
if (num3 < num2 && num3 < num1 && num3 < num4 && num3 < num5)
System.out.printf("%d is the smallest number in the Group ", num3);
if (num4 < num2 && num4 < num3 && num4 < num1 && num4 < num5)
System.out.printf("%d is the smallest number in the Group ", num4);
if (num5 < num2 && num5 < num3 && num5 < num4 && num5 < num1)
System.out.printf("%d is the smallest number in the Group ", num5);
}
}