Java Mysql JavaScript JQuery CSS HTML5 Query Solving Expert

Java Mysql JavaScript JQuery CSS HTML5 Query Solving Expert

Share

Post us your programming problem and you will get the solution within 24 hours. We also provide the DM for any programming related classes or projects.

01/01/2021

03. What will the following program print?

class LoopTest
{
public static void main(String args[])
{
int counter = 0;
outer:
for (int i = 0; i < 3; i++) {
middle:
for (int j = 0; j < 3; j++) {
inner:
for (int k = 0; k < 3; k++) {
if (k - j > 0) {
break middle;
}
counter++;
}
}
}
System.out.println(counter);
}
}

Select 1 option

A. 2

B. 3

C. 6

D. 7

E. 9

https://www.facebook.com/Codingexperts8

Want your school to be the top-listed School/college in Gurugram?
Click here to claim your Sponsored Listing.

Website

Address


Gurugram