MCQ Practice Single Best Answer Topic: ICSE Computer Application - Class X - 2025 PYQ

Q Consider the program segment:

int p = 0;
for (p = 4; p > 0; p -= 2);
System.out.print(p);
System.out.println(p);

The above statements will display:

Question ID
#24165
Subchapter
ICSE Computer Application - Class X - 2025 PYQ
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 42
  • B 420
  • D 00
Correct Answer: C

Explanation

(c) 0
Explanation:

  • The for loop runs but does nothing (; at the end).

  • p starts at 4, then decreases by 2 until p > 0 fails (p = 0).

  • The final value of p is printed twice as 0.

Share This Question

Share this MCQ with your friends or study group.