Swap Two Numbers Program - C# Program

Swap Two Numbers Program

using System;
namespace SwapDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b,c;
            Console.Write("Enter Value of Number A:");
            a = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter value of Number B:");
            b = Convert.ToInt32(Console.ReadLine());
            c = a;
            a = b;
            b = c;   
            Console.WriteLine("After swapping A={0} B={1}", a, b);
        }
    }
}

Output - C# Swap Number Application

Enter Value of Number A: 10
Enter Value of Number B: 20

After swapping A=20 B=10

KeenTPoint Video Tutorial - C# Swap Number Application