Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started