Introduction
We use switch and if to make decisions in code. They help the program choose what to do based on different conditions.
When you have many possible values for one variable and want to run different code for each.
When you want to check simple true/false conditions that are not just about one variable.
When you want clearer code for multiple choices instead of many if-else statements.
When you want to handle a few conditions quickly and simply.
When you want to compare the same variable against many values.