forked from ikismail/JavaBasicPrograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray10.java
More file actions
32 lines (26 loc) · 667 Bytes
/
Array10.java
File metadata and controls
32 lines (26 loc) · 667 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
package Day3;
public class Array10 {
public static void main(String[] args) {
int[] arr = { 2, 3, 5, 7, 6, 9, 1 };
int sum = 0;
int mul = 1;
int max = arr[0];
for (int i = 0; i < arr.length; i++) {
sum += arr[i];
mul *= arr[i];
}
System.out.println("Array List \n");
for (int i : arr) {
System.out.print(i);
}
System.out.println("Maximum Number in Integer");
for (int i = 0; i < arr.length; i++) {
if (max < arr[i]) {
max = arr[i];
}
}
System.out.println("Maximum Number in the list: " + max);
System.out.println("\nAddition of Integers: " + sum);
System.out.println("Multiplication of Integers: " + mul);
}
}