I was doing a java tutorial when I typed this in:
int a = 3;
int b = 4;
int c = 5;
int d = -a*b/c*a;
System.out.println(d);
The output was -6
. However when I use a calculator, I get -36/5
based on the left to right precedence rule. Can someone please explain why there are different answers?