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 291–300 of 376
  1. 291
  2. 292
  3. 293
  4. 294
  5. 295
  6. 296
  7. 297
  8. 298
  9. 299
  10. 300

Question 291

Multiple choice Iteration
What is printed? The indentation is shown exactly as intended. for (int row = 1; row <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 292

Multiple choice Iteration
Across the entire code segment, how many times is col < 2 evaluated? for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 293

Multiple choice Iteration
What is printed? int count = 0; int row; for (row = 0; row < 4; row++) { for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 294

Multiple choice Iteration
What is printed? int count = 0; for (int r = 1; r <= 4; r++) { for (int c =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 295

Multiple choice Iteration
The original loop prints six coordinate pairs. Which replacement for the comment inside the single loop makes it print exactly the same sequence? // Original…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 296

Multiple choice Iteration
Which replacement produces the same final values of both total and i as the original? Each version…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 297

Multiple choice Iteration
For every int n from 0 through 10 inclusive, which replacement leaves total equal to the original…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 298

Multiple choice Iteration
The code is intended to sum all positive odd integers less than or equal to n. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 299

Multiple choice Iteration
For every int n from 1 through 6 inclusive, the code should count all executions of the inner body. Which single edit fixes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 300

Multiple choice Iteration
Which statement describes the code? int x = 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 291 of 376
Page 30 of 38