//Swapping of 2 Numbers using 3rd number
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace cs3
{
class Program
{
static void Main(string[] args)
{
int x, y,z;
Console.WriteLine("Enter any 2 Numbers");
x = int.Parse(Console.ReadLine());
y = int.Parse(Console.ReadLine());
Console.WriteLine("Before Swapping the Numbers are");
Console.Write("First Number:" + x);
Console.Write("\tSecond Number:" + y);
z = x;
x = y;
y = z;
Console.WriteLine("\n\nAfter Swapping the Numbers are");
Console.Write("First Number:" + x);
Console.Write("\tSecond Number:" + y);
Console.ReadLine();
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.