-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathHighest.java
More file actions
33 lines (33 loc) · 812 Bytes
/
Highest.java
File metadata and controls
33 lines (33 loc) · 812 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
import java.util.*;
class Highest
{
static void main()
{
Scanner sn=new Scanner(System.in);
int r,c;
System.out.print("Enter Number of Rows Required:");
r=sn.nextInt();
System.out.print("Enter Number of Columns Required:");
c=sn.nextInt();
int n[][]=new int[r][c];
int i,j;
int h=n[0][0];
for(i=0;i<=r-1;i++)
{
for(j=0;j<=c-1;j++)
{
System.out.print("Enter Elements:");
n[i][j]=sn.nextInt();
}
}
for(i=0;i<=r-1;i++)
{
for(j=0;j<=c-1;j++)
{
if(h<n[i][j])
h=n[i][j];
}
}
System.out.print("Highest:"+h);
}
}