Question: 3. Write a C program to find prime numbers located inside an array. Use the given function to decide whether a number is prime

3. Write a C program to find prime numbers located inside an array. Use the given function to decide whether 

3. Write a C program to find prime numbers located inside an array. Use the given function to decide whether a number is prime or not. Display a number list to indicate number status. (Assume that the numbers are between 1 and 100 and use the following array data). int data[] = {28,81,13,31,54,7, 31, 19, 23, 40, 39, 36, 15, 69, 50, 41, 33,3,5,8)}; int isPrime(int number) { int i; int halfNumber = number / 2; if ((number % 2) == 0) { return 0; } for (i = 3; i < halfNumber; i+=2) { } } if ((number % i) == 0) { return 0; } return 1;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image you provided presents a question which asks to write a C progra... View full answer

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 Programming Questions!