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

Who is the president
Which is a solution to (x − 2)(x + 10) = 13? x = 3 x = 8 x = 10 x = 11
Lana and Ron each opened a separate bank account with $1000. They were both offered a 4.5% interest rate for 2 years. After 2 years, Lana’s account had more mon
Please help its due tommorow Antonym of earlier
Which descriptions of Elizabeth I are accurate? Choose all answers that are correct. A. survived defeat by the Spanish Armada and rebuilt the British navy B
For how many pharaohs was each pyramid constructed?
What is the perimeter of this rectangle? cm----- rectangle labeled 14 centimeters by 5 centimeters.
Which rhetorical device is used in this statement from Dr. Martin Luther King Jr.’s speech “I Have a Dream”? I have a dream that one day this nation will rise u
I'm doing an English poem on colors and I chose pink and yellow. what are some metaphors of the color pink and yellow (give at least 2)?
How was Bulgaria effected during WW2?