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

Talia uses 10 strawberries and 4 oranges to make 8 servings of fruit salad. how many oranges and strawberries does talia need to make 12 servings?
chris and Jana bith measured the distance they live from yhe school. Jana lives closet yhan chris.if chris lives 2/3 mile from the school how far does jana live
The rectangle below has an area of 81- x^2 square meters and a width of 9 - x meters
If the slope of a line is 2/2, does that mean that it increases by 2 units or just 1?
What 2 numbers multiply to 30 and add to -11
There are many more seed plants than non-seed plants. How did the evolution of the seed possibly contribute to the large number of seed plants on Earth?
what is potential energy that depends on height is called what?
How is this excerpt an example of irony?
What are the advantages of new technology
Solve the equation7v=1+8v​