Hi friends,anyone wanted to know the c# swap numbers programs in simple way can go through this
//C# program to enter two number and swap the number
using System;
class Program
static void Main(string[] args)
{
int a, b, temp;
Console.Write("Enter a value : ");
a = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter b value : ");
b = Convert.ToInt32(Console.ReadLine());
Console.Write("Before Swap a={0} b={1}\n", a, b);
temp = a;
a = b;
b = temp;
Console.Write("After Swap a={0} b={1}", a, b);
}
}
Output
Enter a value : 5
Enter b value : 10
Before Swap a=5 b=10
After Swap a=10 b=5
As i am a beginner i got to know the simple and with easy solutions to learn c++,c,c# programs with online compiler from online free tutorials.