//Functions is commonly used to group a series of statements together to achieve a specific objective
//To declare a function
//To invoke a function
//To declare a function
//To invoke a function and catch return in var "result"
//To declare a function
func helloSwift(){
print("hello Swift")
}
//To invoke a function
helloSwift() // the word "hello swift" will be printed
Function that Return value-
func helloSwift() -> String{
return "hello Swift"
}
var result = helloSwift()
//"result" is hello swift
print(result)
No comments:
Post a Comment