Home Tutorials C Tutorial Operators in C
Operators in C

Operators in C


Operators are the symbols that tell the computer to perform specific mathematical or logical manipulations. They are the building blocks of program logic and decision-making.

Primary Operator Groups

Math (Arithmetic)
+, -, *, /, % (Modulus)
Comparison (Relational)
==, !=, >, <, >=, <=
Logic (Logical)
&& (AND), || (OR), ! (NOT)
Shortcut (Assignment)
=, +=, -=, *=

Practical Example

#include <stdio.h>

int main() {
    int a = 10, b = 3;

    printf("Addition: %d\n", a + b);       // Result: 13
    printf("Division: %d\n", a / b);       // Result: 3 (Integer division)
    printf("Remainder: %d\n", a % b);      // Result: 1
    
    // In C, 1 means True and 0 means False
    printf("Is a > b? %d\n", a > b);        // Result: 1

    return 0;
}
Quick Tip: The Modulus operator (%) is incredibly useful for finding even or odd numbers. number % 2 == 0 means the number is even!
Example

🏋️ Test Yourself With Exercises

Take our quiz on Operators in C to test your knowledge.

Browse Quizzes »