0

how does my output come to be as 4 and not 3 in:

int i=1;
int k;

k=i + ++i;
cout<<k<<endl;

So, according to me what happens here is that the first i must be 1 and the (++i) must be 2. So, when they both are added the value of k must be 3 right? Ofcourse I'm missing something. But what?

How
  • 1

0 Answers0