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

Which statements correctly describe why the Renaissance began in the Italian city-states? Choose all answers that are correct. A. The ruins of the Roman Empire
describe North America's location on earth and tell how this affects it's climate and plant and animal life
8.2 is 10% of what number
Who rejected the Worcester vs. Georgia ruling in hopes that the land they occupied would go to white settlers?
What is 43% more than 600? Please show work
What could be A equals 1/4 of 24
Gravity is considered what type of force? conservative non-conservative
how do index minerals help geologist
what are south asia's three largest rivers and what are their source?
Who was responsible for the development of the Communist economic theory, which states that government should control all businesses, that people should not be