forked from krimanisha/Hacktoberfest21
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathARRAYlar.java
More file actions
32 lines (26 loc) · 728 Bytes
/
ARRAYlar.java
File metadata and controls
32 lines (26 loc) · 728 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
import java.io.*;
public class ARRAYlar
{
public static void main (String []arg) throws IOException
{
int n,i,large;
int []a = new int[100];
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("How Many Elements You Wants?");
n=Integer.parseInt(br.readLine());
System.out.print("Enter Array Elements : ");
for(i=0; i<n; i++)
{
a[i]=Integer.parseInt(br.readLine());
}
large = a[0];
for(i=0; i<n; i++)
{
if(large < a[i])
{
large = a[i];
}
}
System.out.print("Largest Number = " +large);
}
}