This is a short program in which you will copy values out of one array and into another based on whether the values are positive, negative, or zero. A template program has been provided for you; to complete this assignment you will fill out the center portion. The template program declares and fills out an array called source. It will be filled with either a fixed set of values or random values, depending on how the symbolic constant RAND_ARR is set. The fixed set of values is provided so you can write your program using known, good values with consistent results. When you are ready, switch the value of RAND_ARR to 1 so that it fills with random values. Whichever array you use, your job is to write the code that copies the values out of the source array and into two new arrays: Copy the value into the pos array if the value is positive. Copy it into the neg array if the value is negative. Ignore the value (don't copy it) if the value is zero. The remainder of the template program will display the contents of the pos array. You will need to provide the code to display the neg array, as well. Functions? For this program, it is not necessary to break apart the program into functions. You can, if you wish, but the emphasis is on practicing to copy arrays. What to Turn In As usual, upload your C file here. Template and Help On most browsers, you will see some tabs below. The first tab contains the template code which you can copy and paste into your Cloud 9 editor. The other tabs contains some help in case you get stuck and need a little push to get started. Template Code Help: Count positive and negative Help: Cory into pos array #include
#include #include // Change this constant to 1 to fill source array // with random values. #define RAND_ARRO #define SRC_SIZE 10 int main() { // Declare source array int source (SRC_SIZE]; // Fill array with random values or constant values if (RAND_ARR == 1) { // Seed random number generator srandom(time(NULL)); // Fill array with random values for (int i = 0; i