asdf

mail@pastecode.io avatar
unknown
plain_text
2 years ago
308 B
0
Indexable
Never
    public static boolean esPrimo(int n){
        int div; //divisor
        if (n<=1){
            return false;
        }
        div = 2;
        while (div <= Math.sqrt(n)){
            if (n % div == 0){
                return false;
            }
            div++;
        }
        return true;
    }