The task is to find and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large.
Solution:
Explanation:
Step 01: Take one variable named "sum" and store an initial value as zero(0).
Step 02: Iterate a for loop through the given array.
Step 03: While iterating the array we are going to add the array element with the variable named "sum".
Step 04: Return the overall summation at the very end after iterating the whole array.
Top comments (2)
In 2023 we will probably put it this way
Thanks for your valuable suggestion. Will try to use it next time.