Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 6PP: (Numerical) a. Define an array with a maximum of 20 integer values, and fill the array with numbers...
icon
Related questions
Question

1) Write a function called initializeArray that receives an array, its size, and two integers and
initializes the array with random values between the first integer and the second integer. Write another
function called printArray that receives an array and its size and prints the array elements in a column. Write
a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive,
and then prints the array using the above functions.


2).  Write a function called evenOdd that receives an integer and determines if it is even or odd.Write a test program that initializes an integer array of size 50 with random integers between 1 and 99
inclusive using initializeArray (from question 1) and determines and displays the number of odd or even
numbers in the array using evenOdd.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr