MCQ
What is the output of the following piece of code?

  • A
    0 1 2 3
  • B
    An exception is thrown
  • C
    0 1 1 2 3
  • 0 1 1 2

Answer

Correct option: D.
0 1 1 2
(d) Explanation: The above piece of code prints the Fibonacci series.

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free