Given a sample code:
1 public class Test {
2 public static void main(String args[]) {
3 int i, j ;
4 for (i = 0; i < 3; i++) {
5 for (j = 1; j < 4; j++) {
6 i %= j;
7 System.out.print(j);
}}
}}
What will be the result of above code ?
(1) 1 2 3
(2) 1 1 2
(3) Repeatedly print 123 and cause infinite loop.
(4) The program compilation fails because of line number 2.
(3)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.