Virtual Classes Logo          Virtual Classes
    Read Anytime,Anywhere

Operators in C++

An operator is a symbol which helps the user to give command to the computer to do a certain mathematical or logical operations. Operators are used in C++ to operate on data and on variables.
C++ operators can be classified as-
(1) Arithmetic Operators: Arithmetic Operators are used to perform arithmetic operation like addition, subtraction, multiplication,division etc. in c++
Plus(+),Subtraction(-),Division(/),Multiplication(*) and Modulus(%) are generally used arithmetic operators in C++.

(2) Relational Operators: Less than(<),Less than or equal to (<=), Greater then(>),Greater then or equal to (>=), equal to (=) and not equal to (!=) are used to compare variable or data in C++.

(3) Logical Operators: And (&&),Not Equal(!)and OR(||) are logical operator in C++,are used to operform logical operator in C++.

(4) Assignment Operators: Assignment operator(=) is used to assign a value to an variable.

(5) Increments and Decrement Operators: Increment/Decrement operator used to increment or decrement the value of a variable. Increment operator(++) is used to increment the value of an operator by 1 and Decrement operator (--) is used to decrement the value of operator by 1.