Gce Model Questions Vol1 2018 Computer Studies Question 4
Practice objective / multiple choice question 4 from the 2018 Gce Model Questions Vol1 Computer Studies examination.
The following Python function is intended to return the sum of the first \(N\) odd numbers, but it contains an error. ```python def sum_odds(N): total = 0 i = 1 count = 0 while count <= N: total += i i += 2 count += 1 return total ``` Identify the error and state the correct output of `sum_odds(7)` after fixing the code.
Answer Options
About This Question
This is Gce Model Questions Vol1 2018 Computer Studies Question 4. It is one of the objective questions from the 2018 Gce Model Questions Vol1 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.