Introduction to C + +: Punctuators and Operators: Arithmetical and Relational Operators

Doorsteptutor material for IAS is prepared by world's top subject experts: fully solved questions with step-by-step explanation- practice your way to success.

Download PDF of This Page (Size: 191K)


  • The following characters are used as punctuators in C++.

  • Brackets [] opening and closing brackets indicate single and multidimensional array subscript.

  • Parentheses () opening and closing brackets indicate functions calls, function parameters for grouping expressions etc.

  • Braces {} opening and closing braces indicate the start and end of a compound statement.

  • Comma, it is used as a separator in a function argument list.

  • Semicolon: it is used as a statement terminator.

  • Colon: it indicates a labelled statement or conditional operator symbol.

  • Asterisk * it is used in pointer declaration or as multiplication operator.

  • Equal sign = it is used as an assignment operator.

  • Pound sign # it is used as pre-processor directive.


  • Operators are special symbols used for specific purposes.

  • C++ provides six types of operators.

Image of Operators

Image of Operators

Arithmetical Operators

  • An operator that performs an arithmetic (numeric) operation: +, -, *, /, or %.

  • The following table shows the arithmetic operators.

Image of Arithmetical Operators

Image of Arithmetical Operators

Relational Operators

The relational operators are used to test the relation between two values. All relational operators are binary operators and therefore require two operands.

A relational expression returns zero when the relation is false and a non-zero when it is true. The following table shows the relational operators.

Image of Relational Operators

Image of Relational Operators

Example 1

The following statements are true.

Developed by: