Professional Documents
Culture Documents
Operators in C
Operators in C
• Arithmetic Operators
• Relational Operators
• Logical Operators
• Increment & Decrement Operators
• Assignment Operators
• Bitwise Operators
• Conditional Operator
• Special Operators
Arithmetic Operators (+, -, *, /, %)
int main(){
int value_before = 5, value_after;
Example:
A = (10<15)?100:200;
Output
A value is 100
Special Operators (sizeof, pointer,
comma and dot)
sizeof operator:
This operator is used to find the size of the
memory (in bytes) allocated for a variable.
This operator is used with the following syntax.
sizeof(variableName);
Example:
sizeof(A);
output:
2 if A is an integer