In C language, Why does n++ execute faster than n=n+1?
n++
n=n+1
(int n=...; n++;) (int n=...; n=n+1;)
Our instructor asked
It doesn't really. The compiler will make changes specific to the target architecture. Micro-optimizations like this often have dubious benefits, but importantly, are certainly not worth the programmer's time.