Neco 2018 Computer Studies Question 15

Practice objective / multiple choice question 15 from the 2018 Neco Computer Studies examination.

Neco 2018 Computer Studies Objective / Multiple Choice Hard Difficulty
Question 15 NECO • 2018 • COMPUTER_STUDIES • objective

Consider the following Python code intended to compute the sum of all natural numbers less than N that are multiples of 3 or 5: ```python total = 0 for i in range(1, N): if i % 3 == 0 and i % 5 == 0: total += i print(total) ``` If the variable `N` is set to 20, (a) identify the logical error in the code, (b) rewrite the condition correctly, and (c) give the correct output produced by the corrected program.

Answer Options

A. 73
Correct Answer B. 78
C. 80
D. 75
Correct Answer
B
Correct Option:
78

About This Question

This is Neco 2018 Computer Studies Question 15. It is one of the objective questions from the 2018 Neco Computer Studies examination.

Difficulty level: Hard .

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