Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Assume int a,x=0,y=0;
- a). a= 10 && ++x && y++
- Values a=0,x =1,y=1 [expected ]
- b). a= 10 && ++x || y++
- Values a=1 ,x=1,y=0 [short circuit
- ,expected ]
- c). a= 10 || ++x || y++
- Values a=1 , x=0, y=0 [short
- circuit ]
- 1. a = 10 && y++
- Values a =0, x=0(default didn't
- change ), y=1 [ expected no short
- circuit y is incremented later and
- hence a =0 ]
Add Comment
Please, Sign In to add comment