Explanation:
I ran this on an online compiler with no issues, so I would try to use a different compiler if I were you. For example, sometimes the compiler can run a different program than the one you're currently on.
I would also recommend cleaning up the code. You don't need anything outside of the first part, as the latter 2 parts don't do anything because the number is already 0 by then.
Here's what I ended up with:
int userNum = 20;
while(userNum >= 1){
System.out.print(userNum + " ");
userNum = userNum/2;
}
return;
My output is:
20 10 5 2 1