Showing Page:
1/1
class prime
{
public static void main(String...s)
{
int n,i;
n=Integer.parseInt(s[0]);
for(i=2;i<n;++i)
{
if(n%i==0)
break;
}
if(i==n)
System.out.println("\nNumber is prime");
else
System.out.println("\nNumber is not prime");
}
}
Output

Unformatted Attachment Preview

class prime { public static void main(String...s) { int n,i; n=Integer.parseInt(s[0]); for(i=2;i
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4