+1 vote
in Class 11 by kratos

What are arithmetic operators in C++? Distinguish between unary and binary arithmetic operators. Give examples for each of them.

1 Answer

+3 votes
by kratos
 
Best answer

Following are the arithmetic operators in C++:

addition(+), subtraction(-), multiplication(*), division(/) and reminder(%).

| Unary arithmetic operators | Binary arithmetic operators |
| Unary Operators has only one operand | Binary operators (”*” as in “two”) have two operands |
| The Unary Operators are ++,--,&,
,+, - etc. | The +, -, &&, <<, ==, >> etc. are binary operators. |
| Example: short x = 987; x = -x; | Example: int x, y = 5, z;z = 10; x = y + z; |

...