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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 73 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 73 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply