Operators:
C operators are symbols used to perform operations on variables and values. Here are some common operators in C:
-
Arithmetic Operators:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Modulus (%)
-
Assignment Operators:
- Assignment (=)
- Addition assignment (+=)
- Subtraction assignment (-=)
- Multiplication assignment (*=)
- Division assignment (/=)
- Modulus assignment (%=)
-
Increment and Decrement Operators:
- Increment (++)
- Decrement (--)
-
Relational Operators:
- Equal to (==)
- Not equal to (!=)
- Greater than (>)
- Less than (<)
- Greater than or equal to (>=)
- Less than or equal to (<=)
-
Logical Operators:
- Logical AND (&&)
- Logical OR (||)
- Logical NOT (!)
-
Bitwise Operators:
- Bitwise AND (&)
- Bitwise OR (|)
- Bitwise XOR (^)
- Bitwise NOT (~)
- Left shift (<<)
- Right shift (>>)
-
Conditional Operator (Ternary Operator):
- ?: (Conditional expression)
-
sizeof Operator:
- sizeof (Returns the size of a data type or variable)
-
Comma Operator:
- , (Used to separate expressions)
These operators are fundamental to performing various operations in C programming.