Functions
Create function
func FunctionName()
{
//do the things inside function
}
Create function
FunctionName()
Parameters in functions
func FunctionName(msg: String, num: Int)
Calling it:
FunctionName(msg: "Wow", num: 5)
Return values in functions:
func FunctionName() -> String
{
return "Hello"
}
func FunctionName()
{
//do the things inside function
}
Create function
FunctionName()
Parameters in functions
func FunctionName(msg: String, num: Int)
Calling it:
FunctionName(msg: "Wow", num: 5)
Return values in functions:
func FunctionName() -> String
{
return "Hello"
}
Comments
Post a Comment