import java.io.*;
class Prime
{
public static void main(String args[])
{
int num=0,flag=0;
System.out.println("Please Enter Your NUmber..");
try
{
DataInputStream dis=new DataInputStream(System.in);
num=Integer.parseInt(dis.readLine());
}
catch(Exception e){}
for(int i=2;i
{
if(num%i==0)
{
flag=1;
break;
}
else
{
flag=0;
}
}
if(flag==0)
{
System.out.println("Number is Prime NUmber..");
}
else
{
System.out.println("Number is Not Prime NUmber..");
}
}
}
No comments:
Post a Comment