Swift Statements

Swift Statements

Swift code is built from statements such as declarations, expressions, and control flow (if, switch, loops).


Expression & Declaration Statements

Declarations introduce names (like variables and constants).

Expression statements evaluate an expression, such as a function call.

Example

let x = 2  // declaration
print(x)    // expression statement

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *