x=x++ gives different results for C and Java? First is compiled in Visual Studio and the other one is in Eclipse. Why results are different?
#include <stdio.h>
int main(void) {
int x=5;
x=x++;
printf("%d",x);
getch();
}
OUTPUT: 6
public class Test {
public static void main(String[] args) {
int x=5;
x=x++;
System.out.println(x);
}
}
OUTPUT: 5