Create a function takes an array of int as a parameter


Discuss the below:

Q1. Write a function that takes an array of int as a parameter and returns a count of odd numbers in the array. Assume the array has MAX elements where MAX is a global constant int. That means that before all of the functions there is a declaration like:

const int MAX = 10;
And arrays are declared like:
int myArray[MAX];

Q2. Write a function that takes an array of int as a parameter and returns the sum of odd numbers in the array. Assume the array has MAX elements where MAX is a global constant int.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a function takes an array of int as a parameter
Reference No:- TGS01936587

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)