Prashnikaप्रश्निका
Code
About
Computer ScienceClass 12

Statements, Scope - ISC Class 12 Computer Science Questions with Answers

4 past-paper questions on Statements, Scope from ISC Class 12 Computer Science papers (2025-2018), newest first, in full. Tap "Show answer" under a question to see its answer. The syllabus covers Conditional statements, Ternary operator, Looping statements, Grouping statements in blocks and Scope and visibility of variables.

4questions
3years
2025newest
20252 questions
1 mark · Assertion-reasonOpen: The break statement prevents fall through effect in switch case construct…

Study the Assertion and Reason and choose the correct option.

Assertion: The break statement prevents fall through effect in switch case construct.

Reason: The break statement enables unnatural exit from the loop.

Given below are two statements marked, Assertion and Reason. Read the two statements carefully and choose the correct option.
  • (a)Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
  • (b)Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
  • (c)Assertion is true and Reason is false.
  • (d)Both Assertion and Reason are false.
Show answer

Answer

Checked answer.

Correct option: (b)

Answer: (b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion. Without break, execution falls through into the following cases, so break does prevent fall through in a switch (Assertion true). break also ends a loop early (Reason true). But the Reason is about loops, while the Assertion is about switch, so the Reason does not explain the Assertion.
1 mark · MCQOpen: For the given code snippet: int i; for( i = 5; i>=1; i--) System.out.println(…

Choose the correct option.

For the given code snippet:
int i;
for( i = 5; i>=1; i--)
    System.out.println( );
System.out.println(i);
  • (a)Zero will be displayed as variable i has local scope with respect to the loop.
  • (b)Zero will be displayed as variable i has global scope with respect to the loop.
  • (c)Error – Undeclared variable i.
  • (d)Output will be 1.
Show answer

Answer

Correct option: b

Answer: (b) Zero will be displayed as variable i has global scope with respect to the loop. The variable i is declared outside the for statement (int i; then for(i=5;...)), so its scope is the enclosing method, not just the loop body. After the loop finishes, i has been decremented to 0, and since i remains in scope, System.out.println(i) prints 0.
20221 question
2 marks · MCQOpen: What is the output of the code given below? int i, j; for(i = 1; i <= 5; i++)…

Choose the correct option.

What is the output of the code given below?
int i, j;
for(i = 1; i <= 5; i++);
for(j = i + 1; j < 1; j++);
System.out.print(i + "+" + j);
  • (a)67
  • (b)1+2
  • (c)6+7
  • (d)12
Show answer

Answer

Correct option: (c)

Answer: (c) 6+7 The first loop ends with i=6. Then j starts at 7 and j<1 is false, so j stays 7. It prints 6+7.
20181 question
2 marks · Short answerOpen: What is exceptional handling? Also, state the purpose of finally block in a try…

Answer the following.

What is exceptional handling? Also, state the purpose of finally block in a try catch statement.
Show answer

Answer

Exception handling is a mechanism in Java to detect and handle runtime errors (exceptions) - abnormal conditions that disrupt the normal flow of a program's execution (e.g. division by zero, array index out of bounds) - using the keywords try, catch, throw, throws and finally, so that the program can respond to the error gracefully instead of terminating abruptly. Purpose of the finally block: The finally block contains code (such as closing files/releasing resources) that must always be executed, whether or not an exception occurs in the try block and whether or not it is caught by a catch block. It is used for essential clean-up code that must run under all circumstances.

About Statements, Scope

Statements, Scope is a unit of the ISC Class 12 Computer Science syllabus.

The syllabus lists these topics: Conditional statements, Ternary operator, Looping statements, Grouping statements in blocks and Scope and visibility of variables.

Prashnika has 4 past-paper questions on Statements, Scope, from papers of 2018-2025, asked in 3 different years. By kind: MCQ (2), Assertion-reason (1) and Short answer (1). They carry between 1 and 2 marks, and most are worth 1 mark.

To practise, use the paper generator, which can build a practice paper from this chapter.

Common questions

What topics are in Statements, Scope in ISC Class 12 Computer Science?

The syllabus lists Conditional statements, Ternary operator, Looping statements, Grouping statements in blocks and Scope and visibility of variables.

How many questions on Statements, Scope are in ISC Class 12 Computer Science past papers?

Prashnika has 4 questions on Statements, Scope, from papers of 2018-2025 (board, specimen, improvement and practice papers together).

What kinds of questions are asked on Statements, Scope?

By kind: MCQ (2), Assertion-reason (1) and Short answer (1).