Check if an integer is a power of 2 using bitwise operators
Filed under NXP
The question
Given an integer, write a C function using bitwise operators to determine whether the number is a power of 2.
No write-up yet. Related questions below have one.
Related NXP questions
Collected from public candidate posts and coding forums. Updated Nov 2026.