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

Is the following nuclear equation balanced? 237 Np - He+233 AM
Who were profoundly influenced by the European enlightenment and spread its ideas in NC
What are the reasons for the several day delay in a primary response. Infection______. A. transport to secondary lymphoid tissue B. antigen processing and prese
Edouard van Beneden proposed that an egg and a sperm, each containing half the complement of chromosomes found in somatic cells, fuse to produce a single cell c
Who is king of Jordan?
The balance sheet of Hidden Valley Farms reports total assets of $450,000 and $550,000 at the beginning and end of the year, respectively. The return on assets
What is circumstance associated with the 1800 election?
7*9=(7*10)-(7*?) what is the value of ? In the equation shown?
which of the following best describes germany's military strategy at the start of world war II
blake buys paperback from the used bookstore for $5 each. Natalie purchased an annual membership to the same bookstore for $35 so she can