We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dde7a46 commit 8934526Copy full SHA for 8934526
src/IntegerArraySum.java
@@ -0,0 +1,23 @@
1
+public class IntegerArraySum {
2
+
3
+ public static void main(String[] args) {
4
5
+ int[] array = { 10, 20, 30 };
6
7
+ int sum = 0;
8
9
+ for (int i : array)
10
+ sum += i;
11
12
+ System.out.print("sum of the given array { ");
13
+ System.out.print(array[0]);
14
+ System.out.print(", ");
15
+ System.out.print(array[1]);
16
17
+ System.out.print(array[2]);
18
19
+ System.out.print("} is ");
20
+ System.out.println(sum);
21
22
+ }
23
+}
0 commit comments