C# Program to Swap two Numbers

This article shows how to swap two integers in C# with source code and output.

Question:
Write a C# program to Swap two Numbers using the third variable.

Solution:
The user input values are passed as an argument in SwapValue function where they are swapped using a third variable temp and the swapped output displayed as shown in the program below.

C-Sharp(C#) Program to Swap two Numbers using third variable.

Source Code:

The output of swapping two integers in C#.