Operators In C++

Operators In C++


                                    

Symbol that tells the compiler to perform specific mathematical or logical manipulations.

There are various types of operators in C++


  1. Arithmetic Operators
  2. Relational Operators
  3. Logical Operators
  4. Assignment Operators
  5. Increment and Decrement Operators
  6. Conditional Operators
  7. Bitwise Operators
  8. Special Operators
  9. Extraction Operators
  10. Insertion Operators
  11. Scope Resolution Operators

+   Arithmetic Operators :

+   :     Addition                      A + B will give 12
-    :     Subtraction                  A - B will give 8
*   : Multiplication             A * B will give 20
/    : Division                     A/B will give 5
%  :      Modulation                 A % B will give 0
++ :      Increment operator A++ will give 11
--   :      Decrement operator    A-- will give 9


May You Like To Read This Related Articles:

What Is Operating System? Knowledge Of OS!!

Operating System As A User Interface And As A Resource Manager - Technopedia!

Services Of Operating System - 
Technopedia!!!

Basic Concepts Of OOPC!!

CONCEPT OF DBMS!!

Types Of Operating System - Technopedia!!!


Basic Program Of C Language For Print Hello!!

Relational Operators :


>     : greater than
>=   : greater than or equal
<     : less than
<=   : less than or equal
==   : equal to
!=    : not equal to

Logical  Operators :


&&   :  logical AND
||       : logical OR
!       : logical NOT

Assignment Operators :

=     :  assign value of right side to the left side
+=   : a+=1 is same as a=a+1
-=    : a-=1 is same as a=a-1
*=   :  a*=1 is same as a=a*1
/=    :  a/=1 is same as a=a/1
%= :   a%=1 is same as a=a%1

Increment and Decrement Operators :


++  : increment value by 1
        a++ is postfix
        a=5,b=a++ then b=5 a=6
        ++a is prefix
        a=5,b=++a then b=6 a=6

--  :   decrement value by 1
        a-- is postfix
        a=5,b=a-- then b=5 a=4
        --a is prefix
        a=5,b=--a then b=4 a=4


Recommend Articles For More Information :

Introduction Of C++!!.

Operators In C++

Function Overloading In C++

Data Types in C++

Types Of Constructor In C++

Classes and Objects In C++

What Is Inheritance In C++?

Types Of Inheritance?

Basic Concepts Of OOPC!!

CONCEPT OF DBMS!!

Basic Program Of C Language For Print Hello!!

Conditional Operators :


Ex : x=(a>b)?a:b; is same as
     if(a>b)
         x=a;
     else
         x=b;

Bitwise Operators :

&    :   bitwise AND
|      : bitwise OR
^     :  bitwise exclusive OR
<<   :   shift left(multiply by 2)
> >  : shift right(divide by 2)

Special  Operators :


&        : Address operator
*         : Pointer operator
,          : Comma operator
sizeof  : It returns the number of bytes the operand occupies
.    :    member selection operator,used in structure
->    :    member selection operator,used in pointer to structure


Extraction Operators :



>> :  used with cin to input data from keyboard

Insertion Operators :


<< :  used with cout to output data from keyboard

Scope Resolution Operators :


::    :   used for the already declared member functions of the class

Comments

Popular posts from this blog

Access Control In Classes For C++

What Is Inheritance In C++? Types Of Inheritance?

Basic Concepts Of OOPC!!