Join Regular Classroom : Visit ClassroomTech

Operators in C

C language has a big set of built-in operators. An operator is a symbol to perform some mathematical or logical operations with data and variables.

Operators can be classified into the following types:

  • Arithmetic Operators
  • Logical Operators
  • Relational Operators
  • Assignments Operators
  • Bitwise Operators

Arithmetic Operators :

Arithmetic operators are used for mathematical operations in c.

Example: Arithmetic Operator

Relational Operators:

Relational operators are used to checking relations between two operands. If the relation is true it returns 1, else it returns 0.

Example 2: Relational Operators

Logical Operators:

C language has 3 logical operators. It is basically used for decision making in c. It returns either 0 or 1 whether the decision is true or false.

Example 3: Logical Operators

Bitwise Operators:

Bitwise operators are used in c programming to perform bit-level operations.

Example 4: Bitwise Operator

Assignment Operator:

These are the assignment operators in c programming.

Special Operators:

There are some special operators in c programming.

Comma Operators:

Comma Operators is used to linking the same expressions.

Example:

Int a, b= 5, c;

sizeof() operators:

It is a unary operator in c which is used to calculate the size of data types.

Example:

 int a =10;

printf(“sizeof (a) =%d”, sizeof(a));

Output:

4

Recent Posts