Program To Check Elements of a 1-D Integer An Array For Primness. Means in array your task is to find the prime number in an array or C++ Program To Check Primness of an Array.
Logic:- To Check primness of array we need to know that how to find the prime number then use a loop and run the program that's it we solve the problem. So Prime number is a number which only can be divided by the 1 or number itself, here are some prime number 2, 3, 5, 7, 11, 13, 17, 19. Important notice here 1 is not a prime number.
Output:
Enter The Size of Array
5
Enter The Element
3 6 7 9 15
3 is Prime
6 is Not Prime
7 is Prime
9 is Not Prime
15 is Not Prime
need an explanation for this answer? contact us directly to get an explanation for this answer