The variable raw_values contains 50 random integers from 1 to 100. Write a nested for loop that
Fantastic news! We've Found the answer you've been seeking!
Question:
The variable raw_values contains 50 random integers from 1 to 100.
Write a nested for loop that calculates the cumulative sum for each element within raw_values and stores it in the variable cumulative_sum.
Pre-allocate cumulative_sum with zeros prior to populating it with your nested for loop.
The cumulative sum is defined as the sum of all the values of elements up to and including the current element. For example, the vector (1,2,3,4,5] has the corresponding cumulative sum vector of (1,3,6,10,15]. Do not use the inbuilt sum or cumsum functions or while loops in this problem.
Posted Date: