Ad

Write a function that takes an integer as input, and returns boolean divisibility by 3 for input argument. You can't use / as operator

Example: The number 3 is divisible by three without leaving a remainder, so the function should return true in this case

function dividedByThree(int $number): bool
{
    $i = 3;
    do {
        if (abs($number) === $i) {
            return true;
        }
        $i += 3;
        
    } while (abs($number) >= $i);
    
    return false;
}