menu
Qamnty
Login
Register
My account
Edit my Profile
Private messages
My favorites
For each of the following while loops, how many times will the loop execute its body? Remember that "zero," "infinity," and "unknown" are legal ans…
Ask a Question
Questions
Unanswered
Tags
Ask a Question
For each of the following while loops, how many times will the loop execute its body? Remember that "zero," "infinity," and "unknown" are legal ans…
asked
Jan 13, 2020
135k
views
1
vote
For each of the following while loops, how many times will the loop execute its body? Remember that "zero," "infinity," and "unknown" are legal answers. a) int x = 1; while (x < 100) { System.out.print(x + " "); x += 10; } b) int max = 10; while (max < 10) { System.out.println("count down: " + max); max--; } c) int x = 250; while (x % 3 != 0) { System.out.println(x); } d) int x = 2; while (x < 200) { System.out.print(x + " "); x *= x; } e) String word = "a"; while (word.length() < 10) { word = "b" + word + "b"; } System.out.println(word); f) int x = 100; while (x > 0) { System.out.println(x / 10); x = x / 2; }
Computers & Tech
high-school
Michael Rut
asked
by
Michael Rut
8.1k
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
Answer:
a.
10
b
. infinity
c.
infinity
d.
3
e.
5
f.
7
Step-by-step explanation:
Ricardus
answered
Jan 19, 2020
by
Ricardus
8.3k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Oct 25, 2024
142k
views
Which of the following loops will print out the numbers 5, 10, 15, 20, 25? I. int i=5; while(i<=25) { System.out.println(i); i=i+5; } II. for(int i=5;i<=25;i=i+5) { System.out.println(i); } III. for(int i=4;i<24;i=i+5) { System.out.println(i+1); }
Brent Bradburn
asked
Oct 25, 2024
by
Brent Bradburn
8.0k
points
Engineering
college
1
answer
2
votes
142k
views
asked
Oct 7, 2024
24.0k
views
Which of the following loops will print out the numbers 3, 5, 7, 9, 11? I. int i=1; while(i<10) { i=i+2; System.out.println(i); } II. int i=3; while(i<=11) { System.out.println(i); i=i+2; } III. for(int i=4;i<=12;i=i+2) { System.out.println(i-1); }
Isaac Overacker
asked
Oct 7, 2024
by
Isaac Overacker
8.0k
points
Engineering
college
1
answer
4
votes
24.0k
views
asked
May 22, 2024
54.8k
views
Consider the following code segment. int j = 1; while (j <= 5) { for (int k = 4; k > 1; k--) { System.out.println("ha"); // line 6 } j++; } How many times will the print statement on line 6 execute? A. 15 B. 16 C. 20 D. 24 E. 25
Jeremy Thille
asked
May 22, 2024
by
Jeremy Thille
8.1k
points
Computers & Tech
high-school
1
answer
4
votes
54.8k
views
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 does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qamnty