JAVA Programming :: Basic Concepts - Discussion
Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion
22 / 64
What all gets printed when the following program is compiled and run. Select the one correct answer.
public class test {
public static void main(String args[]) {
inti=0, j=2;
do {
i=++i;
j—;
} while(j>0);
System.out.println(i);
}
}
public class test {
public static void main(String args[]) {
inti=0, j=2;
do {
i=++i;
j—;
} while(j>0);
System.out.println(i);
}
}
A 0
B 1
C 2
DThe program does not compile because of statement "i=++i;"
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!