Answer:
while(userNum>0)//while loop.
{
cout<<userNum<<" ";//printing the userNum.
userNum/=2;//dividing the userNum.
}
Explanation:
The above-written code should be inserted in the place of the comment your solution should be placed here. In my code I have used a while loop that will run till the userNum is greater than 0. In the loop, I am constantly printing the userNum and dividing it by 2 after printing. This loop will print the same output as written in the question.