Skip to content

Commit

Permalink
Function example
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurwrls committed Oct 30, 2022
1 parent f4250a8 commit 3c73b82
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Simple example of function
// with return statement

let weight = 70.0 // in Kilograms
let height = 1.73 // in Meters


func findBMI() -> Double {
return weight / (height * height)
}

// Wrap function to print in console
print(findBMI())

1 comment on commit 3c73b82

@arthurwrls
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small function example in swift

Please sign in to comment.