write a java program to accept any 20 numbers and display only those numbers which are prime. a number is said to be prime it is divisible by 1 and the number itself .
example 31 , 73 , 67........ are prime numbers
Share
write a java program to accept any 20 numbers and display only those numbers which are prime. a number is said to be prime it is divisible by 1 and the number itself .
example 31 , 73 , 67........ are prime numbers
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.
for ( int i =0;i<=19;i++)
{
if( arr[i]%2==0 || arr[i]%2==1)
{ no is prime
}
else
{ not prime}
}
Answer:
Your answer is in the attachment.
Output also see.