Question: P1- Array Step 1: Write a function isPrime() that gets an integer number and returns true if the number is prime and returns false if

 P1- Array Step 1: Write a function isPrime() that gets an

P1- Array Step 1: Write a function isPrime() that gets an integer number and returns true if the number is prime and returns false if the number is not prime. Hint: A number is prime if it is divisible by only 1 and itself. We have done this part in the class. Step 2: Write a function that get an array and counts and returns the number of elements of the array that are prime (using the function in step 1). Step 3: In your main), create an array of size 100 and initialize it with the first 100 odd numbers, starting 1 (that is 1, 3, 5,..). Use the function in step 2 to count the number of prime numbers in the array. Your C++ code for this HW Page 2 - Copy and paste your code here Then run the program and display the result Sample Run Result Copy and paste the result here (e.g. the screen shot of the result you get by running the code)

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!