Gce Model Questions Vol1 2025 Computer Studies Question 50

Practice objective / multiple choice question 50 from the 2025 Gce Model Questions Vol1 Computer Studies examination.

Gce Model Questions Vol1 2025 Computer Studies Objective / Multiple Choice Medium Difficulty
Question 50 GCE_MODEL_QUESTIONS_VOL1 • 2025 • COMPUTER_STUDIES • objective

The following Python program attempts to compute the sum of all natural numbers below \(N\) that are multiples of 3 or 5. ```python N = 30 sum_3 = sum(i for i in range(N) if i % 3 == 0) sum_5 = sum(i for i in range(N) if i % 5 == 0) # The programmer forgets to remove the double‑counted multiples of both 3 and 5 total = sum_3 + sum_5 print(total) ``` The printed value is therefore incorrect. Using the principle of inclusion‑exclusion, what should the correct total be for \(N = 30\)?

Answer Options

Correct Answer A. 195
B. 180
C. 240
D. 210
Correct Answer
A
Correct Option:
195

About This Question

This is Gce Model Questions Vol1 2025 Computer Studies Question 50. It is one of the objective questions from the 2025 Gce Model Questions Vol1 Computer Studies examination.

Difficulty level: Medium .

Master the Exam!

You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.

Unlock Full Access Available for Android & Windows
Chat with Support