Neco 2019 Computer Studies Question 21

Practice objective / multiple choice question 21 from the 2019 Neco Computer Studies examination.

Neco 2019 Computer Studies Objective / Multiple Choice Hard Difficulty
Question 21 NECO • 2019 • COMPUTER_STUDIES • objective

Consider the following Python code:\n\n```python\ncounter = 0\ndef foo(k):\n global counter\n for i in range(1, k+1):\n if i % 3 == 0:\n counter += i\n else:\n for j in range(i):\n if (j*i) % 4 == 0:\n counter += 1\n return counter\n\nx = foo(5)\ny = foo(3)\n```\n\nAfter executing the code, what is the value of the variable **y**?

Answer Options

A. 5
B. 14
Correct Answer C. 16
D. 18
Correct Answer
C
Correct Option:
16

About This Question

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