City Guilds Model Questions Vol1 2024 Information Technology Question 41

Practice objective / multiple choice question 41 from the 2024 City Guilds Model Questions Vol1 Information Technology examination.

City Guilds Model Questions Vol1 2024 Information Technology Objective / Multiple Choice Hard Difficulty
Question 41 CITY_GUILDS_MODEL_QUESTIONS_VOL1 • 2024 • INFORMATION_TECHNOLOGY • objective

Consider the following pseudocode function: ``` function countPairs(n): count ← 0 for i ← 1 to n: for j ← i to n: if (i + j) mod 3 = 0 then count ← count + 1 return count ``` What integer value does `countPairs` return when the argument is \(n = 10\)?

Answer Options

A. 15
B. 21
C. 20
Correct Answer D. 18
Correct Answer
D
Correct Option:
18

About This Question

This is City Guilds Model Questions Vol1 2024 Information Technology Question 41. It is one of the objective questions from the 2024 City Guilds Model Questions Vol1 Information Technology 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