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

A freakonomics which of the following best summarizes the main idea of this paragraph
The calories in food are an example of which kind of energy?mechanicalelectricalchemical potentialmagnetic
228 divided by 38 step by step
What is 2 to the third power
The equation below describes a proportional relationship between x and y. What is the constant of​ proportionality? Use pencil and paper. Explain why your answe
what is greater 8.43 of 8.340​
Employees should use a disinfectant when cleaning up a surface contaminated by blood. A) TrueB) False
Describe Henry role in the early exploration
I would like some help on my homework
Write each of the following quadratic expressions as a product of linear factors. Verify that the factored form is equivalent.a)x²+12x+27b)x²-16c)x²+16d)x²+4x+5