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 choices based on one variable's value.
When you want clearer code for multiple fixed options.
When you need to check ranges or complex conditions, if is better.
When you want faster decision making for many fixed cases, switch can be faster.
When you want to handle different commands or menu options.