ICSE Class 8 Computer Studies Question 8 of 10

Decision Control Structure — Question 9

Back to all questions
9
Question

Question 9

Write a program to print the Fibonacci series upto 10 terms.
[A series of numbers in which each number is the sum of the two preceding numbers. For example: 0,1,1,2,3, ............... n].

public class KboatFibonacci
{
    public static void main(String args[]) {
        int a = 0;
        int b = 1;
        System.out.print(a + " " + b);
        /*
         * i is starting from 3 below
         * instead of 1 because we have 
         * already printed 2 terms of
         * the series. The for loop will 
         * print the series from third
         * term onwards.
         */
        for (int i = 3; i <= 10; i++) {
            int term = a + b;
            System.out.print(" " + term);
            a = b;
            b = term;
        }
    }
}
Output
BlueJ output of KboatFibonacci.java
Answer

Source: This question is from Decision Control Structure, Computer Studies — Class 8, ICSE Board.

Key Concepts Covered

This question tests your understanding of the following concepts from the chapter Decision Control Structure: Question, Program, Print, Fibonacci, Series, Upto. These are fundamental topics in Computer Studies that students are expected to master as part of the ICSE Class 8 curriculum.

A thorough understanding of these concepts will help you answer similar questions confidently in your ICSE examinations. These topics are frequently tested in both objective and subjective sections of Computer Studies papers. We recommend revising the relevant section of your textbook alongside practising these solved examples to build a strong foundation.

How to Approach This Question

Read the question carefully and identify what is being asked. Break down complex questions into smaller parts. Use the terminology and concepts discussed in this chapter. Structure your answer logically — begin with a definition or key statement, then provide supporting details. Review your answer to ensure it addresses all parts of the question completely.

Key Points to Remember

  • Read the question carefully and identify all parts before answering.
  • Use the terminology specific to this subject and chapter.
  • Review the textbook content for this chapter before attempting questions.
  • Practice writing concise, well-structured answers within time limits.

Practice more questions from Decision Control Structure — Computer Studies, Class 8 ICSE