programming-examples/c-sharp/_Basic/C# Sharp program to swap two numbers.cs
2019-11-15 12:59:38 +01:00

19 lines
606 B
C#

using System;
public class Exercise5
{
public static void Main(string[] args)
{
int number1, number2, temp;
Console.Write("\nInput the First Number : ");
number1 = int.Parse(Console.ReadLine());
Console.Write("\nInput the Second Number : ");
number2 = int.Parse(Console.ReadLine());
temp = number1;
number1 = number2;
number2 = temp;
Console.Write("\nAfter Swapping : ");
Console.Write("\nFirst Number : "+number1);
Console.Write("\nSecond Number : "+number2);
Console.Read();
}
}