Solved

What Is the Output of the Code Snippet Given Below

Question 24

Multiple Choice

What is the output of the code snippet given below?
Int i;
Int j = 0;
For (i = 0; i < 5; i++)
{
If (i % 2 == 0)
{
I = i + 2;
J++;
}
Else
{
I++;
J = j + 2;
}
J++;
}
System.out.println("i=" + i + ", j=" + j) ;


A) i=7, j =7
B) i =7, j =6
C) i =6, j =7
D) i =5, j =5

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions