Question: #include using namespace std; const int SORT_MAX_SIZE = 16; bool isPrime(int n, int i = 2) { if(n == 1) return false; if(n == 2)

#include using namespace std;

const int SORT_MAX_SIZE = 16;

bool isPrime(int n, int i = 2) { if(n == 1) return false; if(n == 2) return true; if (n % i == 0) return false; if (i * i > n) return true;

return isPrime(n, i + 1); }

bool IsArrayPrimeIter(int *arr, int n) { cout

for(int i=0;i

for(int j=2;j*j

cout

bool IsArrayPrimeRecur(int *arr, int n) { cout

if(n==0) { cout

if(isPrime(arr[n-1])) { return IsArrayPrimeRecur(arr, n-1); }

cout

int main() {

cout>n; if(n > SORT_MAX_SIZE) { cout

int *arr = new int[n]; cout>arr[i]; if(arr[i] > 99 or arr[i]

if(IsArrayPrimeIter(arr,n)) { cout

delete[] arr;

return 0; }

How to run this program by the following input?

#include using namespace std; const int SORT_MAX_SIZE = 16; bool isPrime(int n,

6. Run your program in the console with the following inputs: A. Numints = 5, Ints = 53 5099 1223 567 17 B. Numents = 4, Ints = 1871 8069 3581 6841

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!