Operators are symbols used to calculate values, compare them, and make logical decisions. Arithmetic operators handle math calculations, comparison operators check conditions, and logical operators are useful for combining multiple conditions.
c
#include <stdio.h>
int main() {
int x = 10;
int y = 3;
printf("Add: %d
", x + y);
printf("Remainder: %d
", x % y);
printf("Is x greater than y? %d", x > y);
return 0;
}+ adds, % gives the remainder, and x > y checks whether a condition is true. In C, true shows up as 1 and false as 0.
You should see
Add: 13 Remainder: 1 Is x greater than y? 1Info
= assigns a value, while == compares for equality. These two are not the same — don't mix them up.