KnowledgeBoat Logo

Output Questions for Class 10 ICSE Computer Applications

Give the output of the snippet:

int a = 3;
while (a<=10)
{
a++;
if(a== 5)
continue;
System.out.println(a);
}

Java

Java Iterative Stmts

ICSE

18 Likes

Answer

4
6
7
8
9
10
11

Working

aSopln(a)Remarks
3Initial value
441st Iteration
5Not executed due to continue2nd Iteration
663rd Iteration
774th Iteration
885th Iteration
996th Iteration
10107th Iteration
11118th Iteration
  Loop stops as a is greater than 10

Answered By

9 Likes