Operations with number n

Report a typo

What does the following method do?


public static boolean method(int n) {
    if (n == 0) {
        return false;
    } else if (n == 1) {
        return true;
    } else if (n % 3 != 0) {
        return false;
    } else {  
        return method(n / 3);
    }
}
Select one option from the list
___

Create a free account to access the full topic