Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Practice Questions

Work through AP Computer Science A practice 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 251–260 of 383
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

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 252

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 253

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 254

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 255

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 256

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 257

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 258

Multiple choice Iteration
What is the value of count after the following code segment is executed? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 259

Multiple choice Iteration
What is printed by the following code segment? String s = "abcdef"; String r = ""; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 260

Multiple choice Iteration
What is printed by the following code segment? int num = 4738; int sum =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 251 of 383
Page 26 of 39