Question: Create a cpp file named 'main.cpp' that defines an int function named PS() that takes an int array parameter and an int parameter named data

Create a cpp file named 'main.cpp' that

defines an int function named PS() that takes an int array parameter and an int parameter named data and n respectively. Given that n represents the size of data, the function returns the sum positive values (> 0) in data.

defines the main function that

initializes an int array of size 10 with random values such that some values are not positive.

displays a PS() caller whose arguments are the int array and 10 respectively.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!