Skip to content

Instantly share code, notes, and snippets.

@Strelok78
Last active May 16, 2023 15:43
Show Gist options
  • Save Strelok78/eedfbc57dc3a39836341cfb0b224d397 to your computer and use it in GitHub Desktop.
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.
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