int i = 1024; while(i > 0){ std::cout << i << std::endl; i /= 2; }