Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Selection and Iteration, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Subtopic: Iteration Clear filter

Questions 241–250 of 376
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

Multiple choice Iteration
Consider the following code segment. int result = 1; for (int i = 2; i < 7; i = i + 2) { result =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 242

Multiple choice Iteration
Consider the following code segment. int n = 19; int total = 0; while (n > 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 243

Multiple choice Iteration
Consider the following code segment. String s = "aaaa"; int n = 0; while (s.length() > 1…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 244

Multiple choice Iteration
Consider the following code segment. int count = 0; for (int r = 0; r < 3; r++) { for (int c = r;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 245

Multiple choice Iteration
Consider the following code segment. int count = 0; for (int r = 0; r < 4; r++) { for (int c = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 246

Multiple choice Iteration
Consider the following loop: for (int i = 3;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 247

Multiple choice Iteration
What is printed by the following code segment? int n = 100; int count = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 248

Multiple choice Iteration
Which of the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 249

Multiple choice Iteration
How many times is the body of the following loop…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 250

Multiple choice Iteration
What is printed by the following code segment? for (int r = 1; r <= 3; r++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 241 of 376
Page 25 of 38