Page 1 of 1

. This program is about using arrays and using arrays as a parameter of function. It asks the user for a number sz (leng

Posted: Sun May 15, 2022 1:01 pm
by answerhappygod
This Program Is About Using Arrays And Using Arrays As A Parameter Of Function It Asks The User For A Number Sz Leng 1
This Program Is About Using Arrays And Using Arrays As A Parameter Of Function It Asks The User For A Number Sz Leng 1 (142.38 KiB) Viewed 71 times
This Program Is About Using Arrays And Using Arrays As A Parameter Of Function It Asks The User For A Number Sz Leng 2
This Program Is About Using Arrays And Using Arrays As A Parameter Of Function It Asks The User For A Number Sz Leng 2 (60.2 KiB) Viewed 71 times
please use C++
. This program is about using arrays and using arrays as a parameter of function. It asks the user for a number sz (length of the array). Write a program that implement the following function: array_populate(int num[], int sz): This function populates the array num of size sz with random numbers. The numbers should be randomly generated from -99 to 99. • show_array(int num[], int sz): This function shows the values of the num array of size sz in a single line. sum_of_positive(int num[], int sz): This function returns the sum of all positive values of the array num. sum_of_negative(int num[], int sz): This function returns the sum of all negative values of the array num. sum_of_even(int num[], int sz): This function returns the sum of all even values of the array num. sum_of_odd(int num[], int sz): This function returns the sum of all odd values of the array num. Please see the sample output. . . . Sample Output:

Enter the length of the array: 9 The randomly generated array: 64 -79 -5 81 22 86 1 46 -79 Sum of positive numbers in array: 300 Sum of negative numbers in array: -163 Sum of even numbers in array: 218 Sum of odd numbers in array: -81