Today marks the 900th day of learning programming with the cool drizzle!
Hello, everyone! This is the GESP202509 Level 2 problem set.
Day 900


GESP202509 Level 2
Multiple Choice Question
Question 12
Question 12: The output of the following C++ code is related to the count of numbers associated with 5. A number is defined as “associated with 5” if it contains 5 or is divisible by 5. Which of the following statements is correct?

A. Removing the continue statement in the code does not affect the program’s execution result.
B. Removing j = i and changing j within the while loop to i does not affect the program’s execution result.
C. Changing break in the code to j = 0 does not affect the program’s execution result.
D. Changing while (j > 0) to while (j >= 0) does not affect the program’s execution result.
Answer: C
START OF SPRING
Solution:This question tests nested loops.
Option A: Removing continue will prevent subsequent code in the loop body from executing, leading to different results.
Option B: Removing j = i and changing j to i will alter the value of i, causing confusion about its meaning, which will affect the result.
Option C is correct; whether using break or j = 0, both end the current loop.
Option D is incorrect; if changed to j >= 0, the while loop will cause an infinite loop.

20
25
11

NOVEMBER
Day
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
1
12
2
13
3
14
4
15
5
16
6
17
7
Beginning of Winter
8
Chinese Journalist Day
9
Fire Safety Day
10
21
11
22
12
23
13
24
14
25
15
26
16
27
17
28
18
29
19
30
20
October
21
2nd
22
Light Snow
23
4th
24
5th
25
6th
26
7th
27
Thanksgiving
28
9th
29
10th
30
11th
Cool Drizzle
Cool Drizzle
Open Wisdom Station
