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 101–110 of 376
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Iteration
Consider the following code segment: int i = a random number such that 1 <= i <= n; for (int a = 2; a <= i; a++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Iteration
Consider the following code segment: for (int i = 0; i <= 3; i++) { for (int j = i;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Iteration
What are the values of a and b after the for loop finishes? int a = 10; int b…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Multiple choice Iteration
Given the following code segment: for (int j = 1; j <= 5; j++) { for (int k = 1; k <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Multiple choice Iteration
Given the following code segment: int t = 13; while (t < 29) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Iteration
Given the following code segment: int a = 5, b = 2, temp; for (int i = 1; i <= 4; i++) { temp…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 107

Multiple choice Iteration
Consider the following code segment: for(int i = 0; i < 3; i++) { for(int j = 1; j <= 7;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 108

Multiple choice Iteration
Consider the following code segment: for (int i = 0; i = 1; j--)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Iteration
Consider the following code segment: int p = 5; int q = 2; int sum = 0; while (p <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Iteration
Consider the following two code blocks where count and n are both integer values: // Code block I for (count = 0; count…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 376
Page 11 of 38