CSEC Information Technology · May/June 2018 · Paper 1 · Question Q47
Item 47 refers to the following pseudocode and trace table.
a \leftarrow 7
b \leftarrow 1
For n \leftarrow 1 to 3 do
a \leftarrow b + 1
b \leftarrow a + b
\begin{tabular}{|c|c|c|}
\hline
\textbf{n} & \textbf{a} & \textbf{b} \\
\hline
& 7 & 1 \\
1 & 2 & X \\
2 & 4 & 7 \\
3 & 8 & 15 \\
\hline
\end{tabular}
What is the value of X?
- (A)3
- (B)8
- (C)9
- (D)14
This question uses a figure or table from the paper — you'll see it when you practise.
The answer is shown once you've answered.
Practise this question