Swift Return Statement

In this tutorial you will learn about the Swift Return Statement and its application with practical example.

Swift Return Statement

In Swift, the return statement is simply used to return values or expression from enclosing function. The return statement allows you to return single or multiple values in single statement.

Syntax:-

Or

Example:-

Here, return statement return the sum of two number passed in the enclosing function named sum.

When we run the above swift program, we will see the following output –

Output:-

swift_return_statement

swift_return_statement

Recommended:-  Swift Higher Order functions
In this tutorial we have learn about the Swift Return Statement and its application with practical example. I hope you will like this tutorial.