Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Benefits of Using Functions

// function definition
 func getSquare(num: Int) -> Int{
   return num * num
 }

for i in 1...3{

  // function call
  var result = getSquare(num: i)
  print("Square of (i) =",result)
}
 
PREVIOUS NEXT
Tagged: #Swift #Benefits #Using #Functions
ADD COMMENT
Topic
Name
8+8 =