-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD2Array.java
More file actions
41 lines (32 loc) · 955 Bytes
/
D2Array.java
File metadata and controls
41 lines (32 loc) · 955 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
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner; // #include <iostream>
// DONE
public class D2Array
{
public static void main(String[] args)
{
Scanner obj = new Scanner(System.in);
int [][] array = new int[2][3]; // r x c
// INPUT
for (int i = 0; i < 2; i++) // Rows
{
for (int j = 0; j < 3; j++) // Columns
{
System.out.print(" Enter Number at (" + i + "," + j + ")" + " = ");
array[i][j] = obj.nextInt();
}
}
int lowest = array[0][0]; // highest
for (int i = 0; i < 2; i++) // Rows
{
for (int j = 0; j < 3; j++) // Columns
{
if (array[i][j] < lowest)
{
lowest = array[i][j];
}
}
}
System.out.println(" Lowest : " + lowest);
obj.close(); // closing scanner object as this is end now
}
}