---
# System prepended metadata

title: Swift - Swap Two Numbers
tags: [Swift]

---

---
title: 'Swift - Swap Two Numbers'
---


Swap Two Numbers
---

```swift=
var a = 10
var b = 20
print("a = \(a), b = \(b)")

(a,b) = (b,a)

print("a = \(a), b = \(b)")
```
**output** 
> a = 10, b = 20
a = 20, b = 10

###### tags: `Swift`
