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.
| Operator | Operation |
|---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulus |
Example
2. Relational Operators
Used to compare two values.
| Operator | Meaning |
|---|---|
== | 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.
| Operator | Meaning |
|---|---|
&& | Logical AND |
| ` | |
! | Logical NOT |
4. Assignment Operators
Used to assign values.
| Operator | Description |
|---|---|
= | 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.
| Operator | Description |
|---|---|
++ | Increment |
-- | Decrement |
Example
6. Bitwise Operators
Used for bit-level operations.
| Operator | Operation |
|---|---|
& | AND |
| ` | ` |
^ | XOR |
~ | NOT |
<< | Left shift |
>> | Right shift |
7. Conditional (Ternary) Operator
Used as a shorthand for if-else.
Syntax
8. Special Operators
-
sizeof– Finds size of data type -
,– Comma operator -
&– Address of operator -
*– Pointer operator
Operator Precedence (High to Low)
-
Unary operators
-
Arithmetic (
* / %) -
Arithmetic (
+ -) -
Relational
-
Logical
-
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
Register Now
Share this Post
← Back to Tutorials