BCA / B.Tech 9 min read

Operators in C

Operators in the C language:


In the C programming language, operators are symbols that define an operation and are used to perform that operation. Operators work on variables or values and return a result. There are various types of operators in C, which are used to perform arithmetic, logical, bitwise, etc., tasks.

There are mainly seven types of operators in C:
  1. Arithmetic Operators: Used for numerical calculations like addition, subtraction, multiplication, etc.
  2. Relational Operators: Used to compare two variables or values. They always return a boolean value (0 or 1).
  3. Logical Operators: Used for logical tasks, such as combining two or more conditions.
  4. Bitwise Operators: Used to perform operations at the bit level. These operators work on the bits of a variable.
  5. Assignment Operators: Used to assign values to variables.
  6. Increment and Decrement Operators: Used to increase or decrease the value of a variable by one unit.
  7. Conditional Operator (Ternary): Used to check conditions and return a value based on them.

The document includes tables and examples for each category of operator.