Close
Close

associativity of comma and AND

   aMiT PaThAk

int x=2,y=0,l;

int z = y = 1, l = x && y;

printing i here:-

Here as per hieracy first AND would be evaluated which might result 0 as y is inintilised to 0 but it is taking y as 1 but that would be possible only when comma operator gets first evaluated which certainly have lower precedncy than AND.

 

 

 


Answers

Ask Yours
Post Yours
Write your answer