# C Programming operators

Operators are Symbol to execute various mathematical or logical operation. C programming has 7 type of operators:

- Arithmetic
- Relational
- Logical
- Assignment
- Data
- Bitwise Operators
- Miscellaneous

For learning purpose i tried to memorize some operators. Below i have posted them.

## C Programming Arithmetic Operator

Operator | Meaning | Example |
---|---|---|

+ | Additional | 1+1=2 |

- | Subtract | 1-1=0 |

* | Multiply | 3*3=9 |

/ | Divide | 12/3=4 |

++ | Increment | 1++=2 |

-- | Decrement | 2--=1 |

## C programming Relational Operator

Operator | Meaning | Example |
---|---|---|

==' | Equal | 2==2 is true |

!= | Not Equal | 2!=1 is True and 2==1 is False |

> | Greater Than | 2>1 Two is grater than 1 |

< | Less than | 1<2 one is less than two |

>= | Grater than or Equal | 2>=2 two is equal |

<= | Less than or Equal | 1<=2 One is less than 2 |

## C programming Logical Operator

Operator | Meaning | Example |
---|---|---|

&& | Both operand should be non-zero | a&&b true |

|| | One of operand is none-zero | a||b True |

! | Logical Not | !(a&&b) True |

## C programming Bitwise Operator

Operator | Meaning | Example |
---|---|---|

& | And | (c & d)=13 |

| | Or | (c | d)=13 |

^ | (c ^ d)=13 | |

~ | Xor | (~d)=13 |

<< | Shift left | c<<2=15 |

>> | Shift right | d>>2=12 |

## C programming Assignment Operator

Operator | Meaning | Example |
---|---|---|

= | Assign Equal | A=12 |

+= | Assign Plus-equal | B+=A Result is 24 |

-= | Assign Minus-equal | B-=A Result 0 |

/= | Assign Equal-divide | B/=A Same as B=B/A |

*= | Assign Equal-multiple | B*=A Same as B=B*A |

%= | Assign Equal-Module | B%=A Same as B=B%A |

These are the most important operators i am working with mostly. You also can memorize them to write code faster!