C Operators

In C programming language, operators are used to perform different operations on data values. There are various types of operators, such as arithmetic, relational, logical, bitwise, assignment, conditional, and increment/decrement operators. In this table, we will discuss each type of operator in detail:

OperatorDescriptionExample
Arithmetic OperatorsUsed to perform mathematical operations+, -, *, /, %
Relational OperatorsUsed to compare two values>, <, >=, <=, ==, !=
Logical OperatorsUsed to combine two or more conditions&&, `
Bitwise OperatorsUsed to perform operations on binary values&, `
Assignment OperatorsUsed to assign values to variables=, +=, -=, *=, /=, %=, &=, `
Conditional OperatorsUsed to make decisions based on conditions? :
Increment/Decrement OperatorsUsed to increment or decrement the value of a variable++, --

Arithmetic Operators:

Arithmetic operators are used to perform mathematical operations. The table below shows the arithmetic operators in C programming language:

OperatorDescriptionExample
+Additiona + b
-Subtractiona - b
*Multiplicationa * b
/Divisiona / b
%Moduloa % b

Relational Operators:

Relational operators are used to compare two values. The table below shows the relational operators in C programming language:

OperatorDescriptionExample
>Greater thana > b
<Less thana < b
>=Greater than or equal toa >= b
<=Less than or equal toa <= b
==Equal toa == b
!=Not equal toa != b

Logical Operators:

Logical operators are used to combine two or more conditions. The table below shows the logical operators in C programming language:

OperatorDescriptionExample
&&Logical ANDa && b
` `
!Logical NOT!a

Bitwise Operators:

Bitwise operators are used to perform operations on binary values. The table below shows the bitwise operators in C programming language:

OperatorDescriptionExample
&Bitwise ANDa & b
``Bitwise OR
^Bitwise XORa ^ b
~Bitwise NOT~a
<<Left shifta << b
>>Right shifta >> b

Assignment Operators:

Assignment operators are used to assign values to variables. The table below shows the assignment operators in C programming language:

OperatorDescriptionExample
=Simple assignmenta = b
+=