Intel Corporation interview question

Explain what the following code does: ( ( n & ( n-1)) == 0). From cracking the coding interview

Interview Answer

Anonymous

16 Sept 2019

Checks if n is a power of 2 (or if n is 0)

1