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
- 14 Forums
- 1,835 Topics
- 5,051 Posts
- 0 Online
- 1,078 Members
Our newest member: Richardnop
Latest Post: loli
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed