← C Programming learning pathC Programming · Module 3 of 10
Operators and decisions
Calculate with operators and choose paths with if, else and switch.
📖 Key ideas
- Arithmetic: + - * / %; comparison: == != < > <= >=.
- Logical: && (and), || (or), ! (not).
- if/else if/else choose a path.
- switch matches a value against cases; use break in each case.
- In C, 0 is false and any non-zero value is true.
💡 Real-life example: switch is a lift panel: press 3 and it goes straight to floor 3 instead of checking every floor.
%Remainder operator
&&Logical AND
switchChooses a case by value
breakLeaves the switch