import java.io.*;
public class test {
public static void main(String args[]) {
int a=0, b=6, sum;
for(int i=0; i<=2; i++) {
System.out.println(i=i++);
}
}
}
Output: 0 | 1 | 2
. But actually I think it should be 0 | 2
. Please explain why I am wrong? Thank you in advance.