Question: VectorSum (write in C++) Write a function named vectorSum that accepts a vector of integers as a parameter and returns an integer as output. The
VectorSum (write in C++)
Write a function named vectorSum that accepts a vector of integers as a parameter and returns an integer as output. The parameter should not be allowed to be modified by the function and the argument should be passed by reference.
The function should compute the sum of all elements within the array and then return the sum. The elements of the array will be between -100 and +100.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
