28/05/2023 9:58 am
Topic starter

Notifications
Clear all
How do we sum all the elements in an array?
0
How do we sum all the elements in an array?
Answer
Add a comment
Add a comment
1 Answer
0
28/05/2023 2:53 pm
- Initialize a variable sum to store the total sum of all elements of the array.
- Traverse the array and add each element of the array with the sum variable.
- Finally, return the sum variable.
Add a comment
Add a comment
Forum Information
- 22 Forums
- 1,969 Topics
- 5,307 Posts
- 0 Online
- 1,282 Members
Our newest member: TimothySenue
Latest Post: Space bug using " & n b s p ; "
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed