Monday, 23 April 2018

Swap two number using third variable

Swap two number using third variable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication19
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, j, k;
            i = Convert.ToInt32(Console.ReadLine());
            j = Convert.ToInt32(Console.ReadLine());
            k = i;
            i = j;
            j = k;
            Console.WriteLine("after the swap no");
            Console.WriteLine("i=" + i + "\n" + "j=" + j);
            //Console.WriteLine(j);
            Console.ReadLine();
        }
    }
}
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos

0 comments

Post a Comment