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
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}
}
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
7
Answer:
Your answer is in the attachment.
Output also see.
Attachments:
Similar questions