Loop_Practise_Que_03

Home / Java Practice Question / Loop_Practise_Que_03

Loop_Practise_Que_03


WAP to check a given number is Prime or Not....

Program : - 


public class Loop{

    public static boolean isprime(int num)

   {

     for(int i=2;i<num;i++)
{
if(num%i==0)
{
return false;
}
}
return true;
}

}