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

Mini-Project: Cents and the Central Limit Theorem 1. Collect a sample of at least 50 pennies by setting aside all the pennies you receive in change for severa
how were north american colonies all similar in the 1700s?
you have a standard deck of 52 cards. you pick one card and then, with out putting the first card back, you pick a second card. what is the probability that bot
What were the major causes of WWII? Please include at least 4 answers.
How do you?...Multiply out and simplify 10(2x-1)-20x?
Why is sodium sulphate hemihydrate called as "Plaster of Paris"?
Simplify the expressions: cot 0 sec 0 A. Sin0 B. Csc0 C. Cos0 D. Cos* 0
what is a high structure part of a church which has 5 letters
how were north american colonies all similar in the 1700s?
Simplify the expressions: cot 0 sec 0 A. Sin0 B. Csc0 C. Cos0 D. Cos* 0