Question: Please write the code in c++ using arrays only Define an array called nums with a maximum of 20 integers, and fill the array with
Please write the code in c++ using arrays only
Define an array called nums with a maximum of 20 integers, and fill the array with numbers, received from the keyboard (prompt for the numbers.) In this program, exactly 20 integers will be input (no need to use vectors). Then write a function named split() that accepts the array, along with two other arrays called positive and negative. This function places all zeros and positive numbers into positive and all negative numbers into negative. Finally, back in the main, have your program only display the values in the array positive and negative. Do not use vectors in any of your code. The output should look like the following example. You will need to account for in your code that the arrays positive and negative will not necessarily contain 20 numbers. The positive numbers are: 0 4 6 2 100 The negative numbers are: -1 -5 -99 -100 -2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
