Powers of Two Using Bitshift

but instead get 0, 1, 2, 4,

Hint:

 x < 6;

I don't expect x to be greater than 5.