subject
Computers and Technology, 01.01.2021 18:40 727

It seems like no matter what I do this code is still giving me the error " Program end never reached (commonly due to an infinite loop, infinite recursion, or divide/mod by 0).
Tests aborted"
import java. util. Scanner;
public class DivideByTwoLoop {
public static void main (String [] args) {
int userNum = 0;
userNum = 20;
while(userNum >= 1){ System. out. print(userNum + " ");
userNum = userNum/2;
}
if((userNum >1) && !(userNum ==0)){
System. out. print(userNum);
} else {
}
while(userNum !=0) System. out. print(userNum + " ");
System. out. println("");
return; }
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
question
Computers and Technology, 22.06.2019 21:30
Im doing this last minute and literally none of my neighbors or people that my dad works with use excel so if anyone could me make up an example
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
You know the right answer?
It seems like no matter what I do this code is still giving me the error " Program end never reache...
Questions
question
Mathematics, 09.07.2021 03:30
question
Mathematics, 09.07.2021 03:30
question
Mathematics, 09.07.2021 03:30
Questions on the website: 13722359