Rules for ++ and -- operators :
i) Increment (++) and decrement (--) operators are unary operators and they require variable as their operands.
ii) When postfix ++ (or --) is used with a variable in an expression, the expression is evaluated first using the original value of the variable and then the variable is incremented(or decremented) by one.
iii) When prefix ++ (or --) is used in an expression, the variable is incremented (or decremented) first and then the expression is evaluated using the new value of the variable.
The precedence and associatively of ++ and --operators are the same as those of unary + and unary -.
A corner of Computer Science & Engineering related things
Home
4th Semester
Algorithm Design Computer Architecture Database Management System Data Communications Economics5th Semester
Theory of Computation Microprocessor and Assembly Language Engineering Mathematics Sociology Technical Writing and Communications
.