What is the difference between unary and binary operator?give one example of each.
Answers
Answered by
2
Answer:
Arithmetic operators:
Arithmetic operators perform mathematical operations such as addition and subtraction with operands. There are two types of mathematical operators: unary and binary. Unary operators perform an action with a single operand. Binary operators perform actions with two operands. In a complex expression, (two or more operands) the order of evaluation depends on precedence rules.
Unary arithmetic operators:
Unary operators are arithmetic operators that perform an action on a single operand. The script language recognizes the unary operator negative (-).
The negative unary operator reverses the sign of an expression from positive to negative or vice-versa. The net effect is that of multiplying the number by -1. Example:
Similar questions