ICSE Class 10 Computer Applications
Question 30 of 30
Solved Sample Paper 3 — Question 30
Back to all questions 30
Question Question 2(x)
What will be the output of the following program segment?
int a = 100;
while(false)
{
if(a < 50)
break;
a = a - 10;
}
System.out.println(a);Output
100
Explanation
Since the condition of while loop is false, the body of while loop will not execute. The print statement following the loop will execute and print 100 on the screen.