Binary Operators and examples of arithmetic binary operators.

Q18. What are binary operators? Give examples of arithmetic binary operators.

Ans. Operators that act upon two operands are referred to as Binary Operators.

The operands of a binary operator are distinguished as the left or right operand. Together, the operator and its operands constitute an expression.

1. Addition operator +:The arithmetic binary operator + adds values of its operands and the result is the sum of the values of its two operands. For example, 4+20 results in 24.
2. Subtraction operator – : The – operator subtracts the second operand from the first. For example, 14-3 evaluates 11.
3. Multiplication operator *: The * operator multiples the values of its operands. For example, 3*4 evaluates to 12.
4. Division operator /: The / operator divides its first operand by the second. For example, 100/5 evaluates to 20.
5. Modulus operator %: The % operator finds the modulus of its first operand relative to the second. That is it produces the remainder of dividing the first by the second operand. For example, 19 % 6 evaluates to 1, since 6 goes into 9 three times with a remainder 1.
41 Views