1.

Why is the statement ++i faster than i+1?

Answer»
  • ++i instruction uses SINGLE MACHINE instruction LIKE INR (Increment Register) to perform the increment.
  • For the instruction i+1, it requires to LOAD the value of the variable i and then perform the INR OPERATION on it. Due to the additional load, ++i is faster than the i+1 instruction.


Discussion

No Comment Found