---
title: "C# Operators"  
description: "C# Operators — including arithmetic, logical, comparison, assignment, bitwise, and more — with examples and descriptions"  
author: "Anubhav Sharma"  
published: 2025-04-22  
updated: 2025-04-22  
canonical: https://www.mindstick.com/blog/305501/c-sharp-operators  
category: "c#"  
tags: ["c#"]  
reading_time: 3 minutes  

---

# C# Operators

**C# Operators** — including **arithmetic**, **[logical](https://www.mindstick.com/forum/33581/what-is-inserted-deleted-logical-table-in-sql-server)**, **[comparison](https://www.mindstick.com/articles/23182/comparison-maruti-suzuki-celerio-v-s-tata-tiago)**, **[assignment](https://www.mindstick.com/articles/126300/apa-citation-style-get-to-know-about-it-for-your-next-assignment)**, **bitwise**, and more — with examples and descriptions:

**1. [Arithmetic Operators](https://www.mindstick.com/forum/157625/what-is-meant-by-arithmetic-operators-in-python)**

| [Operator](https://www.mindstick.com/blog/144/union-intersection-and-except-operator-in-sql-server) | Name | Example | Description |
| --- | --- | --- | --- |
| `+` | Addition | `a + b` | Adds two operands |
| `-` | Subtraction | `a - b` | Subtracts second operand from first |
| `*` | Multiplication | `a * b` | Multiplies operands |
| `/` | Division | `a / b` | Divides numerator by denominator |
| `%` | Modulus | `a % b` | Returns remainder of division |
| `++` | [Increment](https://www.mindstick.com/forum/173/auto-increment-id) | `a++` or `++a` | Increases value by 1 |
| `--` | Decrement | `a--` or `--a` | Decreases value by 1 |

## 2. Assignment Operators

| Operator | Example | Equivalent To | Description |
| --- | --- | --- | --- |
| `=` | `a = 5` | — | Assigns value |
| `+=` | `a += 2` | `a = a + 2` | Adds and assigns |
| `-=` | `a -= 2` | `a = a - 2` | Subtracts and assigns |
| `*=` | `a *= 3` | `a = a * 3` | Multiplies and assigns |
| `/=` | `a /= 2` | `a = a / 2` | Divides and assigns |
| `%=` | `a %= 2` | `a = a % 2` | Modulus and assigns |

**3. Comparison / [Relational](https://www.mindstick.com/blog/10885/equality-relational-and-conditional-operators) Operators**

| Operator | Example | Description |
| --- | --- | --- |
| `==` | `a == b` | Returns `true` if values are equal |
| `!=` | `a != b` | Returns `true` if not equal |
| `>` | `a > b` | Greater than |
| `<` | `a < b` | Less than |
| `>=` | `a >= b` | Greater than or equal to |
| `<=` | `a <= b` | Less than or equal to |

## 4. Logical Operators

| Operator | Name | Example | Description |
| --- | --- | --- | --- |
| `&&` | AND | `a && b` | True if **both** are true |
| ` |  | ` | OR |
| `!` | NOT | `!a` | Inverts the [Boolean](https://www.mindstick.com/forum/160332/how-does-the-boolean-function-work) value |

**5. [Bitwise Operators](https://www.mindstick.com/forum/160333/what-are-bitwise-operators-and-their-primary-use-cases-in-javascript)**

| Operator | Name | Example | Description |
| --- | --- | --- | --- |
| `&` | AND | `a & b` | Performs bitwise AND |
| ` | ` | OR | `a |
| `^` | XOR | `a ^ b` | Performs bitwise exclusive OR |
| `~` | NOT | `~a` | Inverts all bits |
| `<<` | Left Shift | `a << 2` | Shifts bits to the left |
| `>>` | Right Shift | `a >> 2` | Shifts bits to |

## Read More

[https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/)

---

Original Source: https://www.mindstick.com/blog/305501/c-sharp-operators

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
