Ask your own question, for FREE!
Mathematics 20 Online
OpenStudy (anonymous):

How many times does the computer print the string "Hello"? i = 2 while (i < 4) { print ("Hello") i = i + 1}:

OpenStudy (anonymous):

I think 3 times right?

OpenStudy (accessdenied):

We start with i = 2. Let's just insert the value of i in and check each time we run the while loop. (2 < 4) -> print "Hello", add one now, i =3 (3 < 4) -> print "Hello", add one now, i = 4 (4 < 4) We stop! We printed it twice before we stopped.

OpenStudy (anonymous):

OK, I see.. Thanks

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!