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.
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
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.