
Implement a function that tells you whether an unsigned integer is an exact power of two.
is_power_of_2(8)Expected result
1For your own tracking. Tests grade your code.
is_power_of_2(6)Expected result
0is_power_of_2(0)Expected result
0is_power_of_2(1024)Expected result
1Expected files
is_power_of_2.cAllowed functions
None. Write every helper yourself.

v0.40: Create exercises. Challenge the community.
Meet Studio →Implement a function that tells you whether an unsigned integer is an exact power of two.
is_power_of_2(8)Expected result
1For your own tracking. Tests grade your code.
is_power_of_2(6)Expected result
0is_power_of_2(0)Expected result
0is_power_of_2(1024)Expected result
1Expected files
is_power_of_2.cAllowed functions
None. Write every helper yourself.

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.