Skip to content

Instantly share code, notes, and snippets.

@theerasan
Created February 2, 2018 14:17
Show Gist options
  • Save theerasan/70f4095c406e55b9cff7c28c0a9e4861 to your computer and use it in GitHub Desktop.
Save theerasan/70f4095c406e55b9cff7c28c0a9e4861 to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
var x = 10
var y = 3
println("Before Swapping x = ${x}, y = ${y}")
x += y
y = x - y
x -= y
println("After Swapping x = ${x}, y = ${y}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment