Name: Anonymous 2010-10-22 16:52
int main(void) {
for(int n=0;n!=50;n++)
cout << "Hello, world no. %d\n" << n << endl;
}
int main(void) {
for(int n=0;n!=50;++n)
cout << "Hello, world no. %d\n" << n << endl;
}
int main(void) {
for(int n=0;n!=50;n=n+1)
cout << "Hello, world no. %d\n" << n << endl;
}
int main(void) {
for(int n=0;n!=50;n+=1)
cout << "Hello, world no. %d\n" << n << endl;
}The second code runs fastest, followed by the first code, then the third and fourth tied. I though these were logically the same? Why the speed difference.