Slide 16 It is less standard for ' negative integers -1%3? 3%-1?
Slide 16 • It is less standard for ‘negative integers’ • -1 % 3 ? • 3 % -1 ?
Slide 17 Integer Division Integer division produces an integer result It rounds down the result EXamples ·3/2 evaluates to1 4/6 evaluates to O 10/3 evaluates to 3
Slide 17 Integer Division • Integer division produces an integer result • It rounds down the result • Examples • 3 / 2 evaluates to 1 • 4 / 6 evaluates to 0 • 10 / 3 evaluates to 3
Slide 18 Expression and statement An expression has a value which is the result of some operation(s)on the associated operands Xy,2-a-(b°c) A statement is a sentence that acts as a command it does not have a value it always ends in a, cin>> X, int x: x=5
Slide 18 Expression and statement An expression has a value which is the result of some operation(s) on the associated operands. 4, x-y, 2-a-(b*c) A statement is a sentence that acts as a command it does not have a value it always ends in a ‘;’ cin >> x; int x; x = 5;