Computer Science
Explain Arithmetic operator with an example.
Java Operators
228 Likes
Answer
Arithmetic operators are used to perform mathematical operations on its operands. Operands of arithmetic operators must be of numeric type. A few arithmetic operators operate upon one operand. They are called Unary Arithmetic operators. Other arithmetic operators operate upon two operands. They are called Binary Arithmetic operators.
As an example consider the below statement:
int a = 10 + 20;
Here, the addition arithmetic operator, represented by the symbol + will add 10 and 20. So variable a
will be 30.
Answered By
144 Likes