#include <stdio.h> int IsPowerTwo( unsigned int temp ) { int count = 0; int nbitset = 0; int bit = 0; while( count < 32 ) { bit = ( temp >> count ) & 0x01ul; if(bit) { nbitset++; if( nbitset > 1 ) { return 0; } } count++; } if( nbitset == 1) return 1; else return 0; } int main(void) { int num = 16; if( IsPowerTwo(num) ) { } else { } // your code goes here return 0; }