Question: Q 4 Write the following function ( 5 marks ) : Name: MinMaxEvenOdd Parameters: int N , int a , int b Job: The function

Q4 Write the following function (5 marks):
Name: MinMaxEvenOdd
Parameters: int N, int a, int b
Job: The function will generate and output N random numbers from a to b, including a and b. Assume that a,b, and N are greater than O . It will return the maximum even and minimum odd of the generated N random numbers using two int reference parameters maxEven and minOdd respectively. If there is no maximum even then the parameter maxEven is set to -1. Similarly, if there is no minimum odd then the parameter minOdd is set to -1.
The main() is provided. You only need to write the function. No need to write the full program or any #include statements.
int maino
1
srand(time(0));
int N,a,b, MaxEven, MinOdd;
cout ?-Enter N,a, and b : ;
cin >>N>>a>>b;
MinMaxEvenOdd(N, a, b, MaxEven, MinOdd);
cout "Maximum Even =" MaxEven
cout Minimum Odd =" MinOdd endl;
return 0 ;
I
Write the function here and continue to the other side of the page if required.
 Q4 Write the following function (5 marks): Name: MinMaxEvenOdd Parameters: int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!