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.

Table Of Contents

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

In this tutorial we have learn about the Swift Return Statement and its application with practical example. I hope you will like this tutorial.