Medium
Powers of Two up to n
Read n and print every power of two (1, 2, 4, …) that is ≤ n, on one line, using a while loop.
Input
One integer n ≥ 1.
Output
One line.
Sample 1
Input
20
Output
1 2 4 8 16
Sample 2
Input
1
Output
1
Output appears hereOne integer n ≥ 1.
One line.
20
1 2 4 8 16
1
1
Output appears here