- Arithmetic Operators are the symbols that are used for Arithmetic operations.
- Arithmetic Operators are
% Modulus (Remainder)
- The Operator that is used to assign value to a variable is called an Assignment Operator.
- Assignment Operator ‘=‘ is used to assign value to variable.
- Example int age ; age = 50; or int age = 50;
- Assignment Operator can also be used to assign one value to many variables called Compound Assignment Operator.
- Example int x, y, z; x = y = z = 10;
Increment and Decrement Operators:
|Increment Operator||Decrement Operator|
+ + is used as Increment Operator. It is used to add 1 to the value of a variable. (e.g.) int x = 87; x + +;
– – is used as Decrements Operator. It is used to Subtract 1 to the value of a variable. (e.g.)
int x = 87; x – -;
Prefix and Post fix Operators:
- It adds 1 to the value of the variable before the value of the variable is used in the expression.
- (e.g.) int a = 50, b; b = + +a;
Post fix Operator
- It adds 1 to the value of the variable after the value of the variable is used in the expression.
- (e.g.) int a = 50, b; b = a+ +;
- Relational operator is a symbol that is used to find a relationship between two expressions.
- Relational operator are