I was wondering,is there a difference in execution time between ++i and i++ in the for loop increment?
1)for(int i=0;i<100;++i)
2)for(int i=0;i<100;i++)
I have heard that the one with the pre-increment uses less registers, and hence, it is faster.
Is it correct?
Not these days no; if you can optimise it in your head then you can bet your bottom dollar that a compiler can also optimise it.
If you are in any doubt, check the generated assembly / bytecode &c.