♦ C Operators
♣ About C OperatorsOperators in C are fundamentally used to perform operations on Variables and Values.
Various types of Operators exist in C.
- Comparison Operators
- Arithmetic Operators
- Assignment Operators
- Logical Operators
- Identity Operators
- Membership Operators
- Bitwise Operators
♣ Example1: Comparison Operators in CComparison operator perform comparison between two variable at base level and output a boolean(true/false) value.
Below is the list of comparison operators.
- Greater Than: a > b
- Greater Than or Equal to: a >= b
- Less Than: a < b
- Less Than or Equal to: a <= b
- Equal to: a == b
- Not Equal to: a != b
♣ Example2: Arithematic Operators in CArithmetic Operations in Python are used to perform Mathematical Operations.
♣ Example3: Assignment Operators in CAssignment Operations in Python are used for assignment of (values)/(variable values) to variables.
♣ Example4: Logical Operators in CLogical Operators in C are used to evaluate conditional statements and produce Boolean output.
|&&||returns True if all variables/statements are True|
|||||returns True if atleast one variables/statements are True|
|~||returns the reverse of Boolean value|
Note that 0 corresponds to false and 1 corresponds to true.