-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmax.java
More file actions
40 lines (36 loc) · 908 Bytes
/
max.java
File metadata and controls
40 lines (36 loc) · 908 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
import java.util.Arrays;
import java.util.Scanner;
class max
{
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
int size;
size=s.nextInt();
int[] ar=new int[size];
int mx=ar[0];
//int mn=ar[0];
for (int i = 0; i < size; i++) {
ar[i]=s.nextInt();
}
System.out.println(Arrays.toString(ar));
for (int i = 0; i < size; i++)
{
if (mx < ar[i])
{
mx=ar[i];
}}
int mn=ar[0];
for (int i = 0; i < size; i++)
{
if (mn>ar[i])
{
mn=ar[i];
}
}
System.out.println("max="+mx);
System.out.println("min="+mn);
System.out.println("K P C S S PAVAN");
System.err.println("22NQ1A0548");
}
}