Guest User

Untitled

a guest
Feb 17th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Assume int a,x=0,y=0;
  2. a). a= 10 && ++x && y++
  3.  
  4. Values a=0,x =1,y=1 [expected ]
  5.  
  6.  
  7. b). a= 10 && ++x || y++
  8. Values a=1 ,x=1,y=0 [short circuit
  9. ,expected ]
  10.  
  11. c). a= 10 || ++x || y++
  12. Values a=1 , x=0, y=0 [short
  13. circuit ]
  14.  
  15. 1. a = 10 && y++
  16.  
  17. Values a =0, x=0(default didn't
  18. change ), y=1 [ expected no short
  19. circuit y is incremented later and
  20. hence a =0 ]
Add Comment
Please, Sign In to add comment