What are arithmetic operators in C++? Differentiate unary and binary arithmetic operators. Give example for each of them.
Advertisements
Question
What are arithmetic operators in C++? Differentiate unary and binary arithmetic operators. Give example for each of them.
Advertisements
Solution
Arithmetic operators: perform simple arithmetic operations like addition, subtraction, multiplication, division, etc.
Unary Operators:
- Require only one operand.
- Example: +, -, *, /, %, >, <, <=, AND, OR
Binary Operators:
- Require two operands
- Example: ++ (Plus, Plus) Increment operator, – – (Minus, Minus) Decrement operator, NOT, ~,
APPEARS IN
RELATED QUESTIONS
Which of the following operator is an extraction operator in C++?
Which of the following is a valid string literal?
Which of the following is called compile-time operators?
Write the following real constant into the exponent form:
23.197
Write the following real constant into the exponent form:
0.00005
Match the following.
| A | B |
| (a) Modulus | (1) Tokens |
| (b) Separators | (2) Remainder of a division |
| (c) Stream extraction | (3) Punctuators |
| (d) Lexical Units | (4) get from |
Write about Binary operators used in C++.
Determine which of the following are valid constant? And specify their type.
‘Name’
Determine which of the following are valid constant? And specify their type.
27,822
How relational operators and logical operators are related to one another?
