HERE IS A QUESTION....
Write a program to input 10 elements in an array of integer type and print all the prime numbers present in it.
PLEASE SOLVE AS SOON AS POSSIBLE
Share
HERE IS A QUESTION....
Write a program to input 10 elements in an array of integer type and print all the prime numbers present in it.
PLEASE SOLVE AS SOON AS POSSIBLE
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Explanation:
Prime number is the number that is only divisible by 1 and the number itself. If the number leaves remainder 0 when divided by numbers other than 1 and the number itself then, the number is not said to be a prime number. To print the prime numbers from an array, user has to declare the size of the array size and enter the elements of the array. Prime numbers are identified using iterations with the help of for loop and condition for prime number is specified using if statement. Then the numbers that satisfy the condition i.e, prime numbers are displayed on the screen as output