Assume you are given a function that checks if a number is prime or not (assume
ID: 3651838 • Letter: A
Question
Assume you are given a function that checks if a number is prime or not (assume the function is in a library, therefore you don't need to implement it, but just use it). The function accepts an integer and returns true if the number is prime and false if it is not. The header of the function is as follows: bool is Prime (int a); Write a function that accepts an array of integers and its size and returns the number of prime numbers in the array. You need to use the function is Prime above to check if a number is prime. Write a main function where you make a call to the above function with appropriate parameters of your choice.Explanation / Answer
#include #include"isPrime.h" //or whatever library has isPrime in it using namespace std; int ckprime(int arr[],int size){ int count=0; bool temp; for(int i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.