FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
javaprogram/LargestElement_array.java at master · seeditsolution/javaprogram · GitHub
seeditsolution
javaprogram
Repository navigation
Code
Issues
5
(5)
Pull requests
296
(296)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
javaprogram
/
LargestElement_array.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (15 loc) · 556 Bytes
Breadcrumbs
javaprogram
/
LargestElement_array.java
Copy path
File metadata and controls
16 lines (15 loc) · 556 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public
class
LargestElement_array
{
public
static
void
main
(
String
[]
args
) {
//Initialize array
int
[]
arr
=
new
int
[] {
25
,
11
,
7
,
75
,
56
};
//Initialize max with first element of array.
int
max
=
arr
[
0
];
//Loop through the array
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++) {
//Compare elements of array with max
if
(
arr
[
i
] >
max
)
max
=
arr
[
i
];
}
System
.
out
.
println
(
"Largest element present in given array: "
+
max
);
}
}
Back
|
FazBrowse Home
|
New Git URL