| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
medium Solved by 4 students
For Loop Execution Trace
< Prev
Next >

What output is produced by the following code segment?

for (int i = 1; i < 100; i = i * 2)
{
   if (i / 50 == 0)
      System.out.print(i + " ");
}
A

1 2 4 8 16 32

B

1 2 4 8 16 32 64

C

2 4 8 16 32 64

D

2 4 8 16 32

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1hitrishabhatia11 0m 00s 100
#2sgarv251311 0m 00s 100
#3y.seong202712 0m 49s 41
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy