Computers and Technology

Write a while loop that prints usernum divided by 2 (integer division) until reaching 1. follow each number by a space. example output for usernum = 40:
20 10 5 2 1

import java. util. scanner;

public class dividebytwoloop {
public static void main (string [] args) {
int usernum;
scanner scnr = new scanner(system. in);
usernum = scnr. nextint();

/* your solution goes here */

system. out. println("");
}
}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, 105001964
Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. after the loop terminates, it prints out, on a line by itself and separated by spaces, the sum of all the even integers read, the sum of all the odd integers read, a count of the number of even integers read, and a count of the number of odd integers read, all separated by at least one space. declare any variables that are needed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system. in); is given.
Answers: 3
image
Computers and Technology, 22.06.2019 23:00, brookerebman15
Which type of tab stop is most for weights and measurements?
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, jhonpiper
For her science class, elaine is creating a presentation on weather in the united states. she wants to make the presentation beautiful and interesting by drawing simple cloud or wave shapes. which is the best way for elaine to draw these shapes?
Answers: 1
image
Computers and Technology, 23.06.2019 00:20, mmmmaaarriiieeee
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
Do you know the correct answer?
Write a while loop that prints usernum divided by 2 (integer division) until reaching 1. follow each...

Questions in other subjects: