1. Engineering
  2. Computer Science
  3. write a c program a define an array named numbers...

Question: write a c program a define an array named numbers...

Question details

write a c++ program.

a. Define an array named numbers with a maximum of 20 integer values, and fill the array with numbers assigned by your program. Have your main() function call a function named split()that reads the array and places all zeros or positive numbers in an array named positive and all negative numbers in an array named negative. The split()function should take three array references and the size of the numbers array as input. Finally, have your split() function invoke a function named display()that receives references to both negative and positive arrays as well as the size of each array as input then displays the values in both the positive and negative arrays to the console. Below is an example test run of my solution. Your program’s output must look like this:

The list of numbers before the split:

12 4 76 -3 -6 9 0 -21 234 675 98 87 45 -34 82 68 17 -2 -1 -6

The positive array is:

12 4 76 9 0 234 675 98 87 45 82 68 17

The negative array is:

-3 -6 -21 -34 -2 -1 -6

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution