Arithmetic OperatorsSymbolOperatorDescriptionSyntax
+PlusAdds two numeric values.a + b
MinusSubtracts right operand from left operand.a – b
*MultiplyMultiply two numeric values.a * b
/DivideDivide two numeric values.a / b
%ModulusReturns the remainder after diving the left operand with the right operand.a % b
+Unary PlusUsed to specify the positive values.+a
Unary MinusFlips the sign of the value.-a
++IncrementIncreases the value of the operand by 1.a++
--DecrementDecreases the value of the operand by 1.a--
Relational Operators
<Less thanReturns true if the left operand is less than the right operand. Else falsea < b
>Greater thanReturns true if the left operand is greater than the right operand. Else falsea > b
Less than or equal toReturns true if the left operand is less than or equal to the right operand. Else falsea b
>=Greater than or equal toReturns true if the left operand is greater than or equal to right operand. Else falsea >= b
==Equal toReturns true if both the operands are equal.a == b
!=Not equal toReturns true if both the operands are NOT equal.a != b
Logical Operators
&&Logical ANDReturns true if both the operands are true.a && b
|Logical ORReturns true if both or any of the operand is true.a | b
!Logical NOTReturns true if the operand is false.!a
Bitwise OperatorsSymbolOperatorDescriptionSyntax
&Bitwise ANDPerforms bit-by-bit AND operation and returns the result.a & b
|Bitwise ORPerforms bit-by-bit OR operation and returns the result.a | b
^Bitwise XORPerforms bit-by-bit XOR operation and returns the result.a ^ b
~Bitwise First ComplementFlips all the set and unset bits on the number.~a
<<Bitwise LeftshiftShifts the number in binary form by one place in the operation and returns the result.a << b
>>Bitwise RightshilftShifts the number in binary form by one place in the operation and returns the result.a >> b
Assignment Operators
=Simple AssignmentAssign the value of the right operand to the left operand.a = b
+=Plus and assignAdd the right operand and left operand and assign this value to the left operand.a += b
-=Minus and assignSubtract the right operand and left operand and assign this value to the left operand.a -= b
*=Multiply and assignMultiply the right operand and left operand and assign this value to the left operand.a *= b
/=Divide and assignDivide the left operand with the right operand and assign this value to the left operand.a /= b
%=Modulus and assignAssign the remainder in the division of left operand with the right operand to the left operand.a %= b
&=AND and assignPerforms bitwise AND and assigns this value to the left operand.a &= b
|=OR and assignPerforms bitwise OR and assigns this value to the left operand.a |= b
^=XOR and assignPerforms bitwise XOR and assigns this value to the left operand.a ^= b
>>=Rightshift and assignPerforms bitwise Rightshift and assign this value to the left operand.a >>= b
<Leftshift and assignPerforms bitwise Leftshift and assign this value to the left operand.a < b

Miscellaneous Operators

Apart from the above operators, there are some other operators available in C used to perform some specific tasks. Some of them are discussed here: 

sizeof
sizeof (operand)
  • A compile-time unary operator which can be used to compute the size of its operand.
  • The result of sizeof is of the unsigned integral type which is usually denoted by size_t.
  • Basically, the sizeof the operator is used to compute the size of the variable or datatype.
comma
operand1 , operand2
  • The comma operator (represented by the token) is a binary operator that evaluates its first operand and discards the result, it then evaluates the second operand and returns this value (and type).
  • The comma operator has the lowest precedence of any C operator.
  • Comma acts as both operator and separator. 
ternary/conditional
operand1 ? operand2 : operand3;
  • The conditional operator is the only ternary operator in C++.
  • Here, Expression1 is the condition to be evaluated. If the condition(Expression1) is True then we will execute and return the result of Expression2 otherwise if the condition(Expression1) is false then we will execute and return the result of Expression3.
  • We may replace the use of if..else statements with conditional operators.
member operators
structure_variable . member;

and

structure_pointer -> member // same as (*structure_pointer).member
  • Member operators are used to reference individual members of classes, structures, and unions.
  • The dot operator is applied to the actual object. 
  • The arrow operator is used with a pointer to an object.
cast
(new_type) operand;
  • Casting operators convert one data type to another. For example, int(2.2000) would return 2.
  • A cast is a special operator that forces one data type to be converted into another. 
pointer address of and dereference
&variable

and

*address
  • Pointer operator & returns the address of a variable. For example &a; will give the actual address of the variable.
  • The dereference operator * has the opposite effect. For example *p will give the value that the pointer p points to. In a declaration, it indicates that a variable is a pointer.