Types of operators in C:


Operators are symbols that represent computations, operations, or relationships between operands. 


Arithmetic:



Relational:




Logical:



Bitwise Operators:

 

Bitwise operator works on bits and perform bit-by-bit operation. The truth tables for &,|, and ^ is as follows:




CONDITIONAL:

 

Conditional operator assigns a value to a variable based on some condition.


Syntax:

expression 1 ? expression 2 : expression 3



Example:


int a=10,b=20,c;

c = ( a > b ) ? a : b


Output:

c=20

 

 

All operators have a certain precedence