Answer / Explanation:
#include <iostream> Â
using namespace std;
int main() Â
{ Â Â
 int userNum = 0; Â
 userNum = 20;  Â
 cout << userNum << " ";
 while (userNum > 1)  Â
 {
   userNum = userNum/2;
   cout << userNum << " ";  Â
 }  Â
 cout << endl; Â
 return 0; Â
}
However, we should note that the above codes divides properly but when it gets to 0, it will always give output as 0 instead of terminating the program.
Hence to make it terminate, we include:
while (userNum > 1) Â Â
{
 cout << userNum << " ";  Â
 userNum = userNum/2;
} Â Â
The above code alternatively should be replaced with int userNum = 0; Â .
Also, for the sake of industry best standard and the general principle, we can say:
The general principle is:
while ( <conditional> )
{
 // Use the data
 // Change the data as the last operation in the loop.
}
A for loop provides natural placeholders for these.
for ( <initialize data>; <conditional>; <update data for next iteration> )
{
 // Use the data
} Â
If you were to switch to using a for loop, which I recommend, your code would be:
for ( userNum = 20; userNum > 0; userNum /= 2 )
{
 cout << userNum << " ";