Conditional Statements in Swift- If statement

Swift provides two ways to add conditional branches to your code, known as the if statement and the switch statement. Typically, you use the if statement to evaluate simple conditions with only a few possible outcomes. In its simplest form, the if statement has a single if condition. It executes a set of statements only if that condition is true. The syntax is …