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

question number 4 please help
Ratio of the change in an amount to the original amount expressed as a percent. Dependent variable Percent of change Percent of decrease Percent of increase
The first official U.S. flag, adopted in 1777, had what component(s) on it? a. Thirteen stars and thirteen stripes b. Thirteen stripes and the words “Don’t Tr
This is inverse functions...any help on 3aii?
This song was popular with American troops during the Revolutionary War. Here is a part of its famous refrain: “Stuck a feather in his cap, and called it macar
The Scopes Trial was about: a. Freedom of the press b. Teaching evolution in school c. Prayer in school
What's a Protective tariff?
Who was the oldest signatory of the Declaration of Independence?
Which two U.S. presidents were impeached?
Ratio of the change in an amount to the original amount expressed as a percent. Dependent variable Percent of change Percent of decrease Percent of increase