---
title: "Discussion on \"Swap two numbers with programming\" | Hashnode"
description: "Discussion on \"Swap two numbers with programming\". There are many ways to Swap two numbers in programming. Here I am showing how to swap two numbers optimized and a simple way and also explaining how it works.\nSwap to number using a temporary variable (not optimized. It takes extra space):\nFor Exampl..."
url: "https://hashnode.com/posts/swap-two-numbers-with-programming/63dee6e5fd4c5757d959f74f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Swap two numbers with programming](https://devexplanation.hashnode.dev/swap-two-numbers-with-programming?utm_source=hashnode&utm_medium=feed)

There are many ways to Swap two numbers in programming. Here I am showing how to swap two numbers optimized and a simple way and also explaining how it works. Swap to number using a temporary variable (not optimized. It takes extra space): For Exampl...

Feb 4, 2023 · 4 min read · devexplanation.hashnode.dev  
Read the article

-   [#python3](https://hashnode.com/tag/python3)
-   [#bit-manipulation](https://hashnode.com/tag/bit-manipulation)
-   [#swappingtwonumbers](https://hashnode.com/tag/swappingtwonumbers)

## Written by

[Chirag Patil](https://hashnode.com/@chirag045)

@chirag045

  
[View profile](https://hashnode.com/@chirag045)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
