1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nadusha1986 [10]
3 years ago
7

Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space.

Computers and Technology
1 answer:
Ksenya-84 [330]3 years ago
3 0

Answer:

   while(userNum>=1){

       System.out.print(userNum/2+" ");

       userNum--;

        }

Explanation:

This is implemented in Java programming language. Below is a complete code which prompts a user for the number, receives and stores this number in the variable userNum.

<em>import java.util.Scanner;</em>

<em>public class TestClock {</em>

<em>    public static void main(String[] args) {</em>

<em>    Scanner in = new Scanner (System.in);</em>

<em>        System.out.println("Enter the number");</em>

<em>    int userNum = in.nextInt();</em>

<em>    while(userNum>=1){</em>

<em>        System.out.print(userNum/2+" ");</em>

<em>        userNum--;</em>

<em>         }</em>

<em>    }</em>

<em>}</em>

The condition for the while statement is userNum>=1 and after each iteration we subtract 1 from the value of   userNum until reaching 1 (Hence userNum>=1)

You might be interested in
If you're using an existing PowerPoint presentation that will receive new slides based on a Word outline, select the
oksian1 [2.3K]

ITS D BECAUSE ADDING NEW SLIDES TO AN EXISTING POWERPOINT YOU WILL NEED TO GO TO THE LAST SLIDE TO ADD MORE SLIDES TO IT.

7 0
4 years ago
Students have minutes to complete the aspire science test<br><br>ANSWER<br>55
Oksana_A [137]
11 minutes for 5 days
7 0
4 years ago
Read 2 more answers
Software that manages and supports the resources of a computer is known as?
irakobra [83]
The answer to this question is

<span>Systems software are programs that manage the resources of the computer system and simplify applications programming. They include software such as the operating system, database management systems, networking software, translators, and software utilities.


If you taken a computer course, it tells you this information.

Hope This Helps!
:D
</span>
3 0
3 years ago
Most injury crashes in Florida happen in __________ conditions.
ivolga24 [154]

Answer:

Most injury crashes in Florida happen in dusk conditions

Explanation:

Dusk is the time of the day when the sun is setting. At this time of the day, the visibility on the roads is less. This time of the day, the number of cars on the roads is also significantly greater. This indirectly means that the possibility of most injury crashes in Florida in dusk conditions considerably increases.

The amount of tourism happening in the state is also a condition that takes part in injury crashes due to increased traffic on the roads.

7 0
3 years ago
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
3 years ago
Other questions:
  • When searching for an image on your computer, you should look for a file with which of the following extensions?
    6·1 answer
  • The most popular transmission media option for wired home ethernet networks is ________ cable. fiber-optic power-line unshielded
    15·1 answer
  • Consider a router that interconnects three subnets: subnet 1, subnet 2, and subnet 3. suppose all of the interfaces in each of t
    11·2 answers
  • Write a program that will prompt the user to enter an integer. The program should square the number and then print the squared n
    5·1 answer
  • James would like to send a document he has saved on the hard drive to coworkers in Ireland, Brazil, and India. These coworkers h
    6·2 answers
  • Write a function findWithinThreshold that identifies the elements of a given array that are inside a threshold value. Takes the
    13·1 answer
  • Where do charts get the data series names?
    14·1 answer
  • Work with a partner to answer the following question: How might learning the language
    13·1 answer
  • Which of the following tabs on the Ribbon contains the command to add a Quick Part to a document? A Design B Insert C View D Hom
    7·1 answer
  • Pls help me pls I’m struggling
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!