---
title: "Discussion on \"Swap Two Variables Without a Third One in C++\" | Hashnode"
description: "Discussion on \"Swap Two Variables Without a Third One in C++\". Have you ever wondered if it's possible to swap the value of two variables in C++ without using a third one? Turns out, it's possible and it's not even that hard...\nFirst let's say that we have two integers stored in two separate variables, like this..."
url: "https://hashnode.com/posts/swap-two-variables-without-a-third-one-in-c/5ff4a5e5e8e57e1374e6933e"
---

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

Discussion

# [Swap Two Variables Without a Third One in C++](https://nordic.hashnode.dev/swap-two-variables-without-a-third-one-in-c?utm_source=hashnode&utm_medium=feed)

Have you ever wondered if it's possible to swap the value of two variables in C++ without using a third one? Turns out, it's possible and it's not even that hard... First let's say that we have two integers stored in two separate variables, like this...

Jan 5, 2021 · 2 min read · nordic.hashnode.dev  
Updated Apr 25, 2021  
Read the article

-   [#cpp](https://hashnode.com/tag/cpp)

## Written by

[RedCreator37](https://hashnode.com/@redcreator37)

@redcreator37 · Europe 🇪🇺

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

☕ Java, C++, 🐧 Linux and other software-related stuff ☄

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
