Ad Code

Responsive Advertisement

Report Abuse

Search This Blog

Follow us

top navigation

Tags

Followers

Sports News

[Content Marketing][recentmag]

Labels Cloud

Footer Logo

Tags

Advertisement

Responsive Advertisement

Labels List

Facebook

Popular Posts

recent posts

Content Marketing

[Content Marketing][recentmag]

About us

How accessories make you a better lover. 18 ways devices are completely overrated. Operating systems in 12 easy steps.

Fashion & Lifestyle

[Content Marketing][mag2]

Popular Posts

Skip to main content

Operator's in C++


OPERATOR'S:-
  • The operator's are used to perform different operation such as arithmetic logic etc.
• Operator is used in program to manipulate data and variable.
• The different type of operations are :-
1. Assignment operator
2. Arithmetic Operator
3. Modulo division operator
4. Relational Operator
5. Increment & Decrement Operator
6. Conditional Operator
7. Logical Operator

1. ASSIGNMENT OPERATOR:-
   
 (=) is an assignment operator.
• it is also called as binary type because it has two hands.
 Ex. int a,b;
       a=b;
2. ARITHMETIC OPERATOR:-

• Addition, substraction, multiplication and division are known as arithmetic Operator.
• It is also called binary type because it has two hands.
  Ex. int a,b,c;
          a= 8;
          b= 2;
          c= a/b;
         Output c= 4

3. MODULO DIVISION OPERATOR:-
 
 (%) is known as modulo division operator.
• it is also a binary type and it gives the reminder of a given division.
  Ex. int a,b,c
        a= 10;
        b= 3;
        c= a%b;
  cout<<c;
Output c= 1;

4. Relational Operator:-

• (<,>,<,>,==, Not equal to) are known as relational Operator.
• A relational Operator is used to be comparison.
• if the relation is true then the expression has value of one two. If the relation is false then the expression has value zero.
• it is also a binary type.
   Ex. int a, b;
          a= 20;
          b= 10;
          a<b;
         output = 0 (False)

5. INCREMENT AND DECREMENT OPERATOR:-

• (++) and (--)  are called as increment and  Decrement respectively.
• it is a unary type because it has one hand.
    Ex. int a;
          a = 5;
          a++
        output is 6

     int a;
      a = 4;
      a--
    output is 3

   int a, b;
    a = 5;
    b = ++a
Output is a= 6, b= 6


6. CONDITIONAL OPERATOR:-

• it is a ternary operator.
• in this Operator 3 expression are used.
• One expression is used to relational Operator which is called the main part.
• Others two expression where one true part and another is false part and that way these expression was separated by the symbol collon(:).
      Ex. int a,b,c,d;
           a = 10;
           b = 20;
   ( a<b ? c = 10 : d = 20);

7. LOGICAL OPERATOR:-
  
 • AND(&&), OR(||) , NOT(!) are logical Operator.
• it is a binary type.
•  The logical Operator are useful to combine several relational Operator.

Comments