---
title: "Comment by Royalty on \"Bit manipulation & bitwise operators\" | Hashnode"
description: "Nice article 💯 A little bitwise trick… // swap a and b without an extra variable a = a ^ b b = a ^ b a = a ^ b Try it."
url: "https://hashnode.com/posts/bit-manipulation-bitwise-operators/642ecc1a3d498fea18aa39d7/comment/642ee63b70fdff2e83db56e8"
---

[Discussion](https://hashnode.com/posts/bit-manipulation-bitwise-operators/642ecc1a3d498fea18aa39d7)

Comment [Bit manipulation & bitwise operators](https://hashnode.com/posts/bit-manipulation-bitwise-operators/642ecc1a3d498fea18aa39d7)

[Royalty](https://hashnode.com/@Royalty)

[Apr 6, 2023](https://hashnode.com/posts/bit-manipulation-bitwise-operators/642ecc1a3d498fea18aa39d7/comment/642ee63b70fdff2e83db56e8)

Nice article 💯 A little bitwise trick…

// swap a and b without an extra variable a = a ^ b b = a ^ b a = a ^ b

Try it.

[manga](https://hashnode.com/@codeweb)

[Apr 6, 2023](https://hashnode.com/posts/bit-manipulation-bitwise-operators/642ecc1a3d498fea18aa39d7/comment/642ee63b70fdff2e83db56e8#reply-642f22c17a31ea30695e472d)

Awesome. Thank you
