Operators in C

📘 C 👁 29 views 📅 Dec 22, 2025
⏱ Estimated reading time: 1 min

An operator is a symbol that performs an operation on one or more operands.


Types of Operators in C


1. Arithmetic Operators

Used for mathematical calculations.

OperatorOperation
+Addition
-Subtraction
*Multiplication
/Division
%Modulus

Example

int a = 10, b = 3; printf("%d", a + b);

2. Relational Operators

Used to compare two values.

OperatorMeaning
==Equal to
!=Not equal to
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to

3. Logical Operators

Used to combine conditions.

OperatorMeaning
&&Logical AND
`
!Logical NOT

4. Assignment Operators

Used to assign values.

OperatorDescription
=Assign
+=Add and assign
-=Subtract and assign
*=Multiply and assign
/=Divide and assign

5. Increment and Decrement Operators

Used to increase or decrease value by 1.

OperatorDescription
++Increment
--Decrement

Example

a++; --b;

6. Bitwise Operators

Used for bit-level operations.

OperatorOperation
&AND
``
^XOR
~NOT
<<Left shift
>>Right shift

7. Conditional (Ternary) Operator

Used as a shorthand for if-else.

Syntax

condition ? expression1 : expression2;

8. Special Operators

  • sizeof – Finds size of data type

  • , – Comma operator

  • & – Address of operator

  • * – Pointer operator


Operator Precedence (High to Low)

  1. Unary operators

  2. Arithmetic (* / %)

  3. Arithmetic (+ -)

  4. Relational

  5. Logical

  6. Assignment


Summary

  • Operators perform operations on data

  • C supports multiple operator types

  • Precedence determines order of execution


🔒 Some advanced sections are available for Registered Members
Register Now

Share this Post


← Back to Tutorials

Popular Competitive Exam Quizzes