Operators in C

There are several operators present in C. They may be classified as follows:

Arithmetic Operators:

These operators are used to perform arithmetic operations like addition, subtraction etc. The following table describes the arithmetic operators in descending order of priority.

OperatorsDescription
*, /, % Multiplication, Division, Modular division
+, - Addition, Subtraction
= Assignment

Modular division (%) : returns the remainder after division.

Relational Operators:

These operators are used for comparison between values of two variables. The operators are as follows:

  1. Is Equal To : == :
  2. Is Not Equal To : != :
  3. Is Greater Than: > :
  4. Is Less Than : < :
  5. Is Greater Than Equal To: >= :
  6. Is Less Than Equal To : <= :
Logical Operators:

These operators are used to join multiple conditions so that they may be placed in the same conditional statement. The operators are as follows:

  1. AND Operator: &&:
  2. OR Operator: || :
  3. NOT Operator: ! :
Bitwise Operator:

These operators are used to operate on data at the bit level, i.e. these operators are used too manipulate the bits of a variable. These operators are as follows:

  1. Bitwise AND Operator: & :
  2. Bitwise OR Operator: | :
  3. Bitwise XOR Operator: ^ :
  4. One’s Complement Operator: ~ :
  5. Right Shift Operator: >> :
  6. Left Shift Operator: << :

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

infinite loops, break and continue, switch statement, continue in switch and loops, basic operators, logical operators, logical vs bitwise operators, logical and bitwise or, bit shifting,

# C Programming Language (Prentice Hall Software)
# Let Us C Paperback - 2006 by Yashavant Kanetkar
# Understanding and Using C Pointers Core techniques for memory management
# Data Structures Using C and C++ Paperback - 1998
# Data Structures In C Paperback - August 11, 2008 by Noel Kalicharan