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, 21.06.2019 22:30
Aprovides legal protection for something an individual has created
Answers: 1
question
Computers and Technology, 22.06.2019 03:30
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
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
Chemistry, 05.03.2021 06:50
question
Mathematics, 05.03.2021 06:50
question
Mathematics, 05.03.2021 06:50
question
Mathematics, 05.03.2021 06:50
Questions on the website: 13722363