Neco 2024 Computer Studies Question 30

Practice objective / multiple choice question 30 from the 2024 Neco Computer Studies examination.

Neco 2024 Computer Studies Objective / Multiple Choice Medium Difficulty
Question 30 NECO • 2024 • COMPUTER_STUDIES • objective

The following Python function returns the sum of all integers from 1 to \(n\) that are multiples of 3 or 5 but not both. What value does the function return when called with \(n = 20\)?\n\n```python\ndef special_sum(n):\n total = 0\n for i in range(1, n+1):\n if (i % 3 == 0) ^ (i % 5 == 0):\n total += i\n return total\n```\n

Answer Options

A. 50
B. 98
C. 63
Correct Answer D. 83
Correct Answer
D
Correct Option:
83

About This Question

This is Neco 2024 Computer Studies Question 30. It is one of the objective questions from the 2024 Neco 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