Hello,
Why the following code result is 6?
#include <iostream>
#include <conio.h>
using namespace std;
int main () {
int i=1;
i=(++i)+(++i);
cout<<i;
getche();
return 0;
}
Last edited on
So true(the link by helios).
But can't we guess what algorithm, the system must have followed to get a '6'?
Yupp,
evaluate the parentheses then add them up.