Replacing each Negative Integer with 0 in an Array
This lesson will help you replace negative values in an array with 0 using recursion.
Replacing Negative Values with Zero
Given an array, replace negative values in an array with 0.
The following illustration clears the concept:
Implement the Code
The following code explains how to replace each negative value in the array with 0.
Experiment with the code by changing the values of array to see how it works.
Understanding the Code
A recursive code can be broken down into two parts ...