What are operators ? List the categories of operators supported by C++.

What are operators ? List the categories of operators supported by C++.

Ans. C++ operators are special characters which instruct the compiler to perform operation on some operands. Operation instructions are specified by operators, while operands can be variables, expressions, or literal values. Some operators operate on a single operand and they are called unary operators. Some operators are indicated before operands and they are called prefix operators. Others, indicated after the operands and called prefix operators. Most operators are embedded between the two operands, any they are called infix binary operators. C++ has even an operator that takes three operand,  called a ternary operator. In C++, operators can be classified into various categories based on their utility and action as follows –

  1. Arithmetic operators
  2. Relational operators
  3. Logical operators
  4. Assignment operators
  5. Increment or decrement operators
  6. Conditional operators
  7. Bitwise operators
  8. Special operators.

Share this post