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 51–60 of 376
  1. 51
  2. 52
  3. 53
  4. 54
  5. 55
  6. 56
  7. 57
  8. 58
  9. 59
  10. 60

Question 51

Multiple choice Iteration
Consider the following code segment: int b = 10; String result = ""; while(b < 100) { result += b; b *=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 52

Multiple choice Iteration
Consider the following output. 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 53

Multiple choice Iteration
How many times will the loop execute? int i = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 54

Multiple choice Iteration
Consider the following code segment. int val = 48; int div = 6; while ((val % 2 == 0) && div > 0) { if (val %…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 55

Multiple choice Iteration
Consider the following code segment. int n = 0; while (n < 10) { n += 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 56

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 57

Multiple choice Iteration
Consider the following code segment. int t = 0; for (int v = 1;v < 20;/ * missing increment * / ) { t = t + v; } Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 58

Multiple choice Iteration
Consider the following code segment. int x = 102; int y = 5; int c = 0; while (x - y >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 59

Multiple choice Iteration
Consider the following code segment. for (int j = 0;j < 4;j++) { for ( / * missing code * / ) { System.out.print("(" + j + "," + k + ") "); }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 60

Multiple choice Iteration
Given that n and count are both of type int, which statement is true about the following code segments? I for (count = 1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 51 of 376
Page 6 of 38