- Arithmetic Operators
- Operator Overloading
- Compound Assignment Operators
- Comparison Operators
- Conditions
- Combining Conditions (also called logical operators)
- The Ternary Operator
- Switch Statements
- Range Operators
1. Arithmetic Operators
Swift supports the four standard arithmetic operators for all number types:
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division ( / )
- Remainder ( % )
note: swift cannot add two different data types.
a simple example
let num1 = 3
let num2 = 12
let sum = num1 + num2
print(sum)