Last active
May 16, 2023 15:43
-
-
Save Strelok78/eedfbc57dc3a39836341cfb0b224d397 to your computer and use it in GitHub Desktop.
Two variables are given. Swapping the values of two variables. Displaying the values of variables before and after the permutation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyCode | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string name = "Holmes"; | |
string surname = "Sherlock"; | |
string changer; | |
Console.WriteLine($"{name} {surname}"); | |
changer = name; | |
name = surname; | |
surname = changer; | |
Console.WriteLine($"{name} {surname}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment