Commit ad3408d
committed
feat: Calculate sum of all elements in the array including negatives
🧠 Logic:
- Initialize `sum` to 0.
- Use enhanced for loop (`for-each`) to iterate over all elements in the array.
- Accumulate each value in `sum`, regardless of whether it’s positive or negative.
- Print the final computed sum.
Signed-off-by: Somesh diwan <[email protected]>1 parent b40a34b commit ad3408d
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
0 commit comments