c++ - What is the difference between && and ||? -
this question has answer here: is short-circuiting logical operators mandated? , evaluation order? 7 answers i'm getting difficult understand how following programs work, kindly me in understanding. int x=2,y=0; (i) if(x++ && y++) cout<<x<<y; output: (ii) if(y++ || x++) cout<<x<<" "<<y; output: 3 1 (iii) if(x++||y++) cout<<x<<" "<<y; output: 3 0 kindly explain me how program working , also, makes difference between (ii) , (iii). you looking @ "c++ puzzle" using 2 languages tricks. the first postincrement uses value of variable first, increments variable. so x++ has value 2 in expression , x becomes 3 y++ has value 0 in expression, , y becomes 1 && , || or both operators short-circuiting. look @ && first. in order , tru...