@Himanshuarora: This code violates the sequence point rule (google
it), which essentially says that a variable can change values at most
one time between sequence points. Therefore, the output is compiler
dependent.

Dave

On Sep 21, 6:40 pm, him <himanshuarora.1...@gmail.com> wrote:
> http://www.ideone.com/8iPGF
>
> int main()
> {
> int i=5;
> printf("%d", ++i + ++i + ++i);
> return 0;
>
> }
>
> output : 22
>
> why 22?
> can anybody spell out the reasons and the general way in which the
> expression in evaluated in such cases?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to