kiaraahquin9491 kiaraahquin9491
  • 02-09-2019
  • Computers and Technology
contestada

. What is the output of this code sequence?

for ( int i = 5; i >= 0; i-- )

System.out.print( i + " " );

System.out.println( );

Respuesta :

NanaDwumor
NanaDwumor NanaDwumor
  • 02-09-2019

Answer:

5

4

3

2

1

0

Explanation:

The boolean expression is true from i=5 to i=0. This makes it 6 times.

The System.out.print will leave cursor on same line after printing. However System.out.println() will print a blank space and move to next line. This makes output to be arranged vertically.

Answer Link

Otras preguntas

If a > 0 and b < 0, then which of the following must be true. ab > 0 a + b < 0 a - b > 0 a + b > 0 b - a > 0
what was the first industry to be regulated by the united states goverment?                                               a. oil   b.meat packing  c. steel  D.
I am two numbers, the sum of my numbers is 100, the difference between my two numbers is 30,
how do you solve 2.75+.003+.158=
Who did Odysseus leave behind when he left Troy for Ithaca, and how was it destructive?
Scientists divide rocks into groups based on_________
How do you find the interior angles of a triangle, if only one is given angle is given to you?
How did the early voyages of discovery change european trade routes?
find the area of a triangle given that c=40m b=20m a=48°
Alison wants to find out how much time people spend reading books. She is going to use a questionnaire. Design a suitable question for Alison to use in her ques