[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Basic Concepts - Discussion

Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion

60 / 64

What all gets printed when the following code is compiled and run?

public class xyz {
public static void main(String args[]) {
for(inti = 0; i< 2; i++) {
for(int j = 2; j>= 0; j—) {
if(i == j) break;
System.out.println("i=" + i + " j="+j);
         }
      }
   }
}

A    i=0 j=0

Bi=0 j=1 ,   i=0 j=2 ,  i=1 j=2

C i=0 j=2, i=0 j=3 ,  i=1 j=2

D    i=1 j=2

E    i=2 j=1

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!