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

Prompt Why is it important to eliminate debt as soon as possible? Read More >>
Which of these statements are supported by the data? Select all that apply. a. The amounts of A, T, G, and C in DNA is constant across species. b. The amounts o
Marco polo bought 40 skins for 8 lira? what was the rate in skins per lira and in liras per skin?
3. Is a bone a living structure, or merely a deposit of mineral compounds?
Please help:( I would really appreciate it
Central idea of Screen addiction among teens
Where was the first battle fought
Carlos is 33 years younger than Kristen. 2 years ago, Kristen's age was 2 times Carlos's age. How old is Carlos now?
The movement of the Australian plate pushes Australia north at an average speed of about 17 cm per year. What will Australia's displacement be in meters in 1000
what is -0.75 as a fraction