You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Online Programming/Sum of N/README.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,12 @@
8
8
9
9
3. The space separated array elements are taken as input from user.
10
10
11
-
4. An integer type variable is declared and initialised with value 0 as no array element is added yet.
11
+
4. An integer type variable called *sum*is declared and initialised with value 0 as no array element is added yet.
12
12
13
13
5. Now, a for loop is used to read each element starting from index 0 to N-1 and are simultaneously added to previous value of sum and array element present at that particular loop index.
14
14
15
15
6. Lastly, the variable sum which contains the final answer is printed as the output.
16
16
17
17
Find the link to the problem statement here: https://www.hackerearth.com/practice/basic-programming/implementation/basics-of-implementation/practice-problems/algorithm/array-sum-2-725368ac/
0 commit comments