Skip to content

Instantly share code, notes, and snippets.

@TheMuellenator
Last active July 1, 2024 06:31
Show Gist options
  • Save TheMuellenator/69efa8bb847c58c6bc01a82d3f30fd34 to your computer and use it in GitHub Desktop.
Save TheMuellenator/69efa8bb847c58c6bc01a82d3f30fd34 to your computer and use it in GitHub Desktop.
iOS repl.it - Variables Challenge Solution
var a = 5
var b = 8
var c = a
a = b
b = c
print("a: \(a)")
print("b: \(b)")
Copy link

ghost commented Aug 9, 2021

var a = 1
var b = 2
var c = a
a = b
b = c
print("a: (a)")
print("b: (b)")

@lamuqeetios
Copy link

var a = 7
var b = 9
var c = a
b = a
a = b
print("a is = (a)")
print ("b is = (b)")

@Magdalenaspace
Copy link

var a = 7
var b = 8
var c = a
a = b
b = c

@fatmayildiza
Copy link

func exercise() {

var a = 5
var b = 8

//Write your code here. 
//Dont change any of the existing code.


print("a: \(b)")
print("b: \(a)")

}

it is working:))

@ziashah
Copy link

ziashah commented Jul 1, 2024

var a = 5
var b = 7

a = a + b // 12
b = a - b // 12 - 7 = 5
a = a - b // 12 - 5 = 7

print("a: (a)")
print("b: (b)")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment