Press "Enter" to skip to content

## 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
`+`Addition`a + b`
`-`Subtraction`a - b`
`*`Multiplication`a * b`
`/`Division`a / b`
`%`Modulo`a % b`

## Relational Operators:

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

OperatorDescriptionExample
`>`Greater than`a > b`
`<`Less than`a < b`
`>=`Greater than or equal to`a >= b`
`<=`Less than or equal to`a <= b`
`==`Equal to`a == b`
`!=`Not equal to`a != 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 AND`a && 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 AND`a & b`
``Bitwise OR
`^`Bitwise XOR`a ^ b`
`~`Bitwise NOT`~a`
`<<`Left shift`a << b`
`>>`Right shift`a >> 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 assignment`a = b`
`+=`