The expression n++ requires a single machine instruction such as INR to carry out the increment operation whereas, n+1 requires more instructions to carry out this operation.
The expression n++ requires a single machine instruction such as INR to carry out the increment operation whereas, n+1 requires more instructions to carry out this operation.<br>If n+1 is executed,the value of n should be stored in memory,then bring to CPU and perform addition in CPU and then write to memory back.Hence,CPU time is consumed more.<br>Compilers nowadays are smarter,if it encounters n+1,it replaces it by n++.Hence,it really doesn't matters for user since optimization is gained by compiler.
n++ requires only to increment the value of n by one,while n=n+1 means first add 1 to the n and then perform the assignment operation =<br>thus it requires two tasks to be performed while n++ requires only one task to be performed.
It depends on the target architecture. If the architecture does not support the INC/ DEC instruction, then n++ and n = n +1 will be same. Means, same kind of instruction will be generated.
all high level lang are converted first to machine instruction and its the machine instruction on which the speed of execution of our program depend so n=1 means use of add instr of var and store value it it too time taking so we prefer n++ for faster execution.