itechlanders
itechlanders itechlanders
  • 24-05-2017
  • Mathematics
contestada

How many times does the computer print the string "Hello"? i = 2 while (i < 4) { print ("Hello") i = i + 1}:

Respuesta :

LammettHash
LammettHash LammettHash
  • 24-05-2017
[tex]i=2<4[/tex] is true, so "Hello" is printed, then we increment [tex]i[/tex] by 1.

Now [tex]i=3[/tex] and [tex]3<4[/tex], so "Hello" gets printed again.

Next [tex]i=4[/tex], but [tex]4<4[/tex] is false, so the while loop is broken.

So, the loop only prints "Hello" twice.
Answer Link

Otras preguntas

What is the midpoint of 0.01 and 0.02
Which of the original thirteen colonies is being described below? Free land was offered to immigrants that would come to the area, be patient, and wait for citi
A ball is projected horizontally from the top of a 92.0-meter high cliff with a horizontal speed of 19.8 m/s. Determine the maximum range of ball.
the law of {blank} of matter states that matter can neither be created nor destroyed
20{5[100-2(25+25)+20)]
How do you estimate 403,446 +396,755
Where is the weather most likely clear and dry
Which of the following is a true statement about chloroplasts?   A. They transport glucose into the cell.
a cuboid has a square base of side x cm. The height of the cuboid is (x +4) cm. The volume of the cuboid is 150cm cubed. Show that x cubed +4x cubed = 150
What is one tenth of 80