Answers for "is number power of 2 using c++"

C++
0

power of two c++

bool IsPowerOfTwo(int x) {
    return x && ((x & (x - 1)) == 0);
}
Posted by: Guest on March-27-2021
0

c++ power of two

int xSquared = pow(x, 2);
Posted by: Guest on April-13-2021

Browse Popular Code Answers by Language