C++ - Operators

In C++, operators are used to perform various operations on data, such as arithmetic calculations, assignment, comparison, logical operations, and bitwise operations.

Category Operators Description
Arithmetic Operators + Addition
- Subtraction
* Multiplication
/ Division
% Modulo (remainder)
Assignment Operators = Simple assignment
+= Addition assignment
-= Subtraction assignment
*= Multiplication assignment
/= Division assignment
%= Modulo assignment
Comparison Operators == Equality
!= Inequality
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
Logical Operators && Logical AND
! Logical NOT
Bitwise Operators & Bitwise AND
^ Bitwise XOR
~ Bitwise NOT (complement)
<< Bitwise left shift
>> Bitwise right shift