Module: Binary shifts (C++)


Problem

4/4

Checking if a number is a power of two

Problem

Given a number x. Check if a number is a power of two.

Add the missing piece of code to the program.
 

 

Examples
# Input Output
1 2 1
2 3 0