#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) )
	{
		printf("the number %d is power of 2 \n", num);
	}
	else
	{
		printf("the number %d is not power of 2 \n", num);
	}
	
	// your code goes here
	return 0;
}
