Neco 2017 Computer Studies Question 31

Practice objective / multiple choice question 31 from the 2017 Neco Computer Studies examination.

Neco 2017 Computer Studies Objective / Multiple Choice Medium Difficulty
Question 31 NECO • 2017 • COMPUTER_STUDIES • objective

A program reads an integer \(n\). It initialises \(sum = 0\) and then executes a loop for \(i\) from 1 to \(n\). Inside the loop, if \(i\) is odd, it adds \(i \times 2\) to \(sum\); otherwise it adds \(i \div 2\). What is the final value of \(sum\) when \(n = 7\)?

Answer Options

Correct Answer A. 38
B. 22
C. 56
D. 44
Correct Answer
A
Correct Option:
38

About This Question

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