Accenture Java Programming Practice Question
What will be the output of the following code? int i=20; if(i>10) { System.out.println( "The value of i is "+i); i++; if(i%2!=0) break; }Answer options
A
Compilation fails
B
Code compiles but will not execute
C
The value of i is 10
D
The value of i is 20
Correct answer: Compilation fails
Explanation
Correct answer: Compilation fails.