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 261–270 of 376
  1. 261
  2. 262
  3. 263
  4. 264
  5. 265
  6. 266
  7. 267
  8. 268
  9. 269
  10. 270

Question 261

Multiple choice Iteration
What is printed by the following code segment? int a = 1; int b =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 262

Multiple choice Iteration
What is printed by the following code segment? for (int i = 3; i >= 1; i--) { for (int j = 1; j <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 263

Multiple choice Iteration
What is printed? for (int i = 2; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 264

Multiple choice Iteration
What is printed? int n = 5; while (n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 265

Multiple choice Iteration
What is printed? int x = 8; int count = 0; while (x <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 266

Multiple choice Iteration
How many times is i <= 6 evaluated, and how many times does the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 267

Multiple choice Iteration
What is printed? int i; for (i = 2; i <= 7; i +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 268

Multiple choice Iteration
What is printed? int total = 0; for (int i = 1; i <= 6; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 269

Multiple choice Iteration
Each version starts with int n = 3 and int total = 0. What are the final totals for Version I and Version II,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 270

Multiple choice Iteration
The int n is from 0 through 10 inclusive. Which replacement makes total equal to the sum of all integers from 1…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 261 of 376
Page 27 of 38