Arithmetic Operators and Expression
Arithmetic Operators and Expression
and Expression
Defining Variables
Examples:
char c = 'a';
float x(1.875);
Constant Objects
The sign operator – returns the value of the operand but inverts
the sign.
Examples:
int n = –5; cout << -n; // Output: 5
Increment / Decrement Operators
Examples:
z = 7.5;
y = z;
x = 2.0 + 4.2 * z;
Multiple Assignments