Question: (Use C++ please) Write a function countPrimes that takes in two parameters: an int array and the size of the array. The function returns the

(Use C++ please) Write a function countPrimes that takes in two parameters: an int array and the size of the array. The function returns the count of the number of prime elements in the array. int countPrimes(int array[], int size) Given array: {1, 2, 3, 4, 5, 7, 10, 12} Expected return: 4 Explanation: The primes are 2, 3, 5, and 7; consequently, the function returns a count of 4. Hint: Create a function IsPrime to call from within your countPrimes function

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!