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

Summarize this quote from Washington's Farewell Address Please! “The spirit of encroachment tends to consolidate the powers of all the departments in one, and t
Using a simple machine, a student is able to lift a 500N weight by applying only 100N. What is the mechanical advantage of the simple machine?
Where does the freshwater that you use in your home come from
What affects the density of a substance? Select all that apply. Mass Gravity Volume Weight
how can simple interest make saving money easier
Who is the first person to discover Narnia? A. Lucy B. Susan C. Edmund D. Peter
billy plays outside for a half of hour how mintues billys played outside
If you burn 42.5 g of hydrogen and produce 3.80 × 102 g of water, how much oxygen reacted?
TJ bought 3 t-shirts & a pair of shorts for $15. If each shirt was $4.25, how much were the shorts? $2.25 $9.50 $12.75 $15
Given rectangle PQRS with PQ congruent to QR, PQ congruent to SP and SQ is 5 square root 2, find RQ.