-
Notifications
You must be signed in to change notification settings - Fork 0
/
Q_14.java
39 lines (32 loc) · 872 Bytes
/
Q_14.java
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
package New;
import java.util.Random;
import java.util.Scanner;
public class Q_14 {
// TODO Auto-generated method stub
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
Random num = new Random();
int max=0,min=0;
int res[][][]=new int[3][4][6];
for ( int i = 0; i <3; i++ ) {
for(int j=0;j<4;j++) {
for(int k=0;k<6;k++) {
res[i][j][k] =1+num.nextInt(70);
System.out.println(res[i][j][k]);
if(i==0 && j==0 && k==0) {
min=res[i][j][k];
max=res[i][j][k];
}
if(res[i][j][k]>max) {
max=res[i][j][k];
}
if(res[i][j][k]<min) {
min=res[i][j][k];
}
}
}
}
System.out.println("Max="+max);
System.out.println("Min="+min);
}
}