Example code:
var a = 5
var b = 8
print(“a: \(a)”)
print(“b: \(b)”)
// To make the values of “a” and “b” reversed, see the code below. //
var c = a
a = b
b = c
print(“a: \(a)”)
print(“b: \(b)”)
The printed value is:
a: 5
b: 8
a: 8
b: 5
Example code:
var a = 5
var b = 8
print(“a: \(a)”)
print(“b: \(b)”)
// To make the values of “a” and “b” reversed, see the code below. //
var c = a
a = b
b = c
print(“a: \(a)”)
print(“b: \(b)”)
The printed value is:
a: 5
b: 8
a: 8
b: 5