Operators in C++

Operators in C++

Operators in C++ are special type of functions and it is symbol used to perform operations. Operators takes one or more arguments and produces a new value. It is used to perform various operations on variables and constants.

 

C and C++ has many built-in operators and they are follows:

Arithmetic Operators

Arithmetic operators are used to perform arithmetic operations on variables

Examples: (+, -, *, /, %,++,–)

Relational Operators

A relational operator is used to check the relationship between operands.These operators establish a relationship between operands. The relational operators are less than (<) , grater thatn (>) , less than or equal to (<=), greater than equal to (>=), equivalent (==) and not equivalent (!=).

Logical Operators

The logical operators are AND (&&) and OR (||) and it used to combine two different expressions together.

Bitwise Operators

Bitwise operators are used to change bits into a number. Bitwise operators work with only integral data types like int, char and long.

Assignment Operators

Assignment Operates ‘=’ is used to takes the right-hand side and copy it into the left-hand side.

 

 

Read more, Type Conversion in C++

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *