What do the last lines mean?
a=0;
b=0;
c=0;
a && b++;
c || b--;
Can you vary this question to explain with more interesting example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For the example you gave: if
ais nonzero, incrementb; Ifcis zero, decrementb.Due to the rules of short-circuiting evaluation, that is.
You could also test this out with a function as the right-hand-side argument;
printfwill be good for this since it gives us easily observable output.Output: