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

How did the Agricultural Revolution spread to Europe from the Middle East?
Help someone please I’m not asking fa much
Causwell Company began 2018 with 11,000 units of inventory on hand. The cost of each unit was $4.00. During 2018 an additional 35,000 units were purchased at a
What was the name of th first English settlement in new England
Roosevelt wanted Congress to repeal ______________. a. foreign policy c. expansion policy b. isolation policy d. imperialism
Please answer this correctly
What do you believe is stopping youfrom being successful in school?​
A certain volume of a gas had a pressure of 800 torr at a temperature of -40 degrees C. What was the original volume if the volume at STP is now 450.0 cm^3? (th
Given: Lines y and z are parallel, and ABC forms a triangle. Prove: m25 + m_2 + m26 = 180° M
Chrzan, Inc., manufactures and sells two products: Product E0 and Product N0. Data concerning the expected production of each product and the expected total dir