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

Solve for u. Simplify your answer as much as possible.
In a class of 10, there are 5 students who play soccer. If the teacher chooses 2 students, what is the probability that both of them play soccer?
6. Latin word meaning "forest land" i tried google translate an its not that
what impact did president Andrew Jacksons actions in the 1830s have on the economy?​
Use inductive reasoning to predict the next line in this sequence of computations. Then use a calculator or perform the arithmetic by hand to determine whether
calvin buys a book for $14.70, which is a %30 discount off the original price
Re write the quadratic function in standard formy=6(x-3)^2+4
What is the GCF of 8 and 20 O 8 O2 O 4 O 10
After 4 minutes of reading, Aaron was on page 14 of his book. After 8 minutes he was on page 20. Which equation models the page number, y, in terms of minutes x
A change in temperature causes a change in density. \ True False