menu
Qamnty
Login
Register
My account
Edit my Profile
Private messages
My favorites
How many times does the computer print the string "Hello"? i = 2 while (i < 4) { print ("Hello") i = i + 1}:
Ask a Question
Questions
Unanswered
Tags
Ask a Question
How many times does the computer print the string "Hello"? i = 2 while (i < 4) { print ("Hello") i = i + 1}:
asked
Oct 15, 2018
14.7k
views
5
votes
How many times does the computer print the string "Hello"? i = 2 while (i < 4) { print ("Hello") i = i + 1}:
Mathematics
college
Alaster
asked
by
Alaster
8.0k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
7
votes
is true, so "Hello" is printed, then we increment
by 1.
Now
and
, so "Hello" gets printed again.
Next
, but
is false, so the while loop is broken.
So, the loop only prints "Hello" twice.
Hannes
answered
Oct 19, 2018
by
Hannes
7.8k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
No related questions found
Ask a Question
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.
Categories
All categories
Mathematics
(3.7m)
History
(955k)
English
(903k)
Biology
(716k)
Chemistry
(440k)
Physics
(405k)
Social Studies
(564k)
Advanced Placement
(27.5k)
SAT
(19.1k)
Geography
(146k)
Health
(283k)
Arts
(107k)
Business
(468k)
Computers & Tech
(195k)
French
(33.9k)
German
(4.9k)
Spanish
(174k)
Medicine
(125k)
Law
(53.4k)
Engineering
(74.2k)
Other Questions
What is .725 as a fraction
How do you estimate of 4 5/8 X 1/3
A bathtub is being filled with water. After 3 minutes 4/5 of the tub is full. Assuming the rate is constant, how much longer will it take to fill the tub?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qamnty