Operators in C

Definition: Operators do some operation on operands.

There are three different categories:

  1. Unary – Only one operand needs to perform a task.
  2. Binary – Two operands.
  3. Ternary – Three operands.

Now we will see more in depth about types of Operators :

Arithematic Operator:

+ , – , / , * , %

 

Relational Operator:

> , >= , < , <= , == , !=

 

Logical Operator:

&& (AND), || (OR) , !  (NOT)

 

Assignment Operator:

=

 

Bitwise Operator:

& (AND), | (OR), ^ (X-OR), ~ (COMPLIMENT)

 

Shift Operator:

>> (Right shift) , << (left Shift)

 

Increment & Decrement Operator:

++ , —

 

Sizeof Operator :

sizeof()

 

Comma Operator:

‘  ,  ‘

 

Reference Operator (Unary):

&

 

D – Reference Operator (Unary):

* (pointer)

 

Ternary Operator (conditional operator):

__ ? __ : __

 

 

 

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: