Daily C++ Challenge – Day 836

Today is the 836th day of learning programming with a slightly cold rain!

Hello, everyone! This is the GESP Level 1 Exam Questions for June 2025.

Day 836

Daily C++ Challenge - Day 836Daily C++ Challenge - Day 836

GESP Level 1 Exam Questions for June 2025

Question 10: The following C++ code is used to determine what day of the week it will be after M days. The code to fill in the two blanks is (

).

int N, M, D;

cout << “What day of the week is it currently? “; // Sunday is 0

cin >> N;

cout << “How many days later? “; // Input a positive integer

cin >> M;

D = ____________;

if (____________)

printf(“%d days later is Sunday”, M);

else

printf(“%d days later is day %d”, M, D);

A、(N + M) / 7

D == 0

B、(N + M) % 7

D == 0

C、(N + M) / 7

D <= 0

D、(N + M) % 7

D = 0

Answer: B

START OF SPRING

Solution: This question tests the use of the modulus operator in C++.

When N + M modulo 7 equals 0, a special case needs to be handled, representing Sunday.

Daily C++ Challenge - Day 836

20

25

9

Daily C++ Challenge - Day 836

SEPTEMBER

Sun

Mon

Tue

Wed

Thu

Fri

Sat

1

10th

2

11th

3

Victory Day of the War of Resistance

4

13th

5

14th

6

Ghost Festival

7

White Dew

8

17th

9

18th

10

Teachers’ Day

11

20th

12

21st

13

22nd

14

23rd

15

24th

16

25th

17

26th

18

September 18 Incident

19

28th

20

29th

21

30th

22

August

23

Autumn Equinox

Harvest Festival

24

3rd

25

4th

26

5th

27

6th

28Class

7th

29

8th

30

Martyrs’ Memorial Day

@XIUMI

Slightly Cold Rain

Open Wisdom Station

Daily C++ Challenge - Day 836

Leave a Comment