Question

Step 2: Programming (4 x 4 = 16 pts)

Exercise 2) (4 Pts)

Write a program named "Exercise2.cpp", which reads one integer and displays the numbers of

power-of-2 until the input value. Don't show any number more than the input. The following

show two test cases.

Type one integer here.

1000

2 4 8 16 32 64 128 256 512

Type one integer here.

50000

2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768

Question image 1