Gce Model Questions Vol1 2025 Computer Studies Question 3

Practice objective / multiple choice question 3 from the 2025 Gce Model Questions Vol1 Computer Studies examination.

Gce Model Questions Vol1 2025 Computer Studies Objective / Multiple Choice Medium Difficulty
Question 3 GCE_MODEL_QUESTIONS_VOL1 • 2025 • COMPUTER_STUDIES • objective

The following pseudocode searches for a target value in an array. ``` 1. SET i = 1 2. WHILE i <= n DO 3. IF array[i] = target THEN 4. PRINT "Found at position", i 5. EXIT LOOP 6. ENDIF 7. i = i + 1 8. ENDWHILE 9. IF i > n THEN 10. PRINT "Not found" 11. ENDIF ``` Assuming the array is indexed from 0 to \(n-1\) (as in most programming languages), identify the off‑by‑one error and provide the corrected line(s) of code.

Answer Options

Correct Answer A. SET i = 0 ; WHILE i < n DO
B. SET i = 0 ; WHILE i <= n DO
C. SET i = 1 ; WHILE i < n DO
D. SET i = 1 ; WHILE i <= n DO
Correct Answer
A
Correct Option:
SET i = 0 ; WHILE i < n DO

About This Question

This is Gce Model Questions Vol1 2025 Computer Studies Question 3. It is one of the objective questions from the 2025 Gce Model Questions Vol1 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