MCQs > IT & Programming > JSharp - J# > A class named MyLoop is defined as follows: public class MyLoop { public static void main(String args[]) { int counter = 0; lbl1: for (int i=10; i<0; i--) { int j = 0; lbl2: while (j < 10) { if (j > i) break lbl2; if (i == j) { counter++; continue lbl1; } } counter--; } System.out.println(counter); } } What will happen when you try to compile and run the program?

JSharp - J# MCQs

A class named MyLoop is defined as follows:
public class MyLoop
{
           public static void main(String args[])
        {
               int counter = 0;
               lbl1: for (int i=10; i<0; i--)
                {
                  int j = 0;
                   lbl2:  while (j < 10)
                        {
                               if (j > i) break lbl2;
                                if (i == j)
                                 {
                           counter++;
                           continue lbl1;
                                }
                           }
                           counter--;
               }
       System.out.println(counter);
           }
}
What will happen when you try to compile and run the program?

Answer

Correct Answer: The program will print 0 as output

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JSharp - J# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it