[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

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);
   }
}

A    0

B    1

C    2

DThe program does not compile because of statement "i=++i;"

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!