Last Updated: 24 Oct, 2019

Check prime

Easy

Problem statement

What will be the output of the following code:

 public static boolean isPrime(int x)
{
    for(int i=2;i<x/2;i++)
    {
        if(x%i==0)
        return false;
    }
    return true;

}
public static void main (String[] args) {
    System.out.print(isPrime(47));
}