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 do you say I have brown hair in Spanish ( not the google translate way )
cabeza de vacas la relacion is an example of an historical record what is the purpose of this record A. to promote the benefits of exploration B. to convince
Jillian receives a $30 gift card to use at a movie theater. She spends $11 on her movie ticket and she wants to spend the remaining amount on p packs of popcorn
if a rectangular field is 0.35 kilometers long and 0.3 kilometers wide . what is the area of the field in square meters?
Only need help with The angle the road makes with horizontal
Which structure in the ear contains tiny hairs that send nerve impulses to the brain, which processes them as sound?
Much of what scientist know about Australopithecines comes from the Lucy skeleton true or false?
summarize the new lands that the colonists gained from the treaty of paris?
In a scale drawing, a 42-foot tree is drawn 6 inches high. the flag pole next to it is drawn 7-inches high. how tall is the actual flag pole
In a property transaction, the homeowner increasingly has a legal responsibility to