Computer Programming (4) - Operators and Expressions


administrivia

Web Page - http://www.cs.tau.ac.il/~efif/courses/ComputerProgramming


what’s an operator?


types of operators


expressions


expression concepts


lvalue


examples


why do we care?


conversions


conversions


some caveats


usual arithmetic conversions


conversion rules


conversion example


operator precedence and associativity


precedence


associativity


associativity example


arithmetic operators


the modulus operator


precedence and associativity

Precedence Associativity Operator
13 left *, /, %
12 left +, -

arithmetic operator example


increment/decrement operators


single operand


preincrement/predecrement


postincrement/postdecrement


increment/decrement operators (cont.)


precedence and associativity


increment example


simple assignment operator


value of assignment expression


compound assignment operators


precedence and associativity


assignment issues


relational operators


relational operators


precedence and associativity


relational operator issues

lectures prev top next
Maintained by Efi Fogel. Last modified: November 12 2002.