[Solved] : Question 13558

int y = 5,x;
x = (++y)+ (++y);
cout<<x;
I would expect the value 13, but I got 14 as the output. any pointers?
what is funny is that the following code gives the value 13.

int y=5;
int x = (++y) + (++y);
cout<<x;
The difference lies in declaration….! so how does it matter?


Expert Answer


Answer to : Question 13558

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?