Computer Science, asked by ICSEgirl, 1 year ago

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

Answers

Answered by Ronaldo1226
25
data store ij. array
for ( int i =0;i<=19;i++)
{
if( arr[i]%2==0 || arr[i]%2==1)
{ no is prime
}
else
{ not prime}
}

ICSEgirl: full program u write
Answered by kamalrajatjoshi94
7

Answer:

Your answer is in the attachment.

Output also see.

Attachments:
Similar questions