PRIME/NOT-PRIME USING FOR AND IF-ELSE
hey @Kamyanagpal
use return statement
inside the if and else condition :
if(n%i==0){
System.out.println( " wohooooo non- prime");
return ;
}
else{
System.out.println(" it 's prime);
return ;
}
hey @Kamyanagpal
use return statement
inside the if and else condition :
if(n%i==0){
System.out.println( " wohooooo non- prime");
return ;
}
else{
System.out.println(" it 's prime);
return ;
}