0

The code is supposed to return the next square if current number is perfect square

function findnextsquare(sq)
{
    return Math.sqrt(sq)%1?-1:
    Math.pow(Math.sqrt(sq)+1,2);
}

0 Answers0