if x = 3 and z is unassigned,
why does z = x-- - --x evaluates to 2?
my professor is lecturing about this at the moment, and I’m currently stuck with this dilemma. Unfortunately, no one can explain why it happens.
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.
on x–, x = 3, and after that it’s 2.
on –x, x = 1, because substraction (from 2) is done beforehand.
Therefore, 3 – 1 = 2.