Example 1: if/else

You selected gender as Male

Example 2: switch/case

You selected gender as Male.

Explanation

Conditional statements allow programs to make decisions and control which code runs based on a true or false test. The if/else structure checks a condition and runs different code depending on the result, while a switch/case compares a single value against multiple options, which is often cleaner for fixed choices like menus or categories.