using System;

namespace MyCompiler 
{
    class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello world!");
            int n,i;
            MadNumbers test = new MadNumbers();
            int[] arr1 = {1, 4, 2};
          
            test.madOperation2(arr1, 0, arr1.Length - 1);
            Console.Write ("\n\n");
        }
    }
    class MadNumbers
    {
        public void madOperation1 (ref int a, ref int b)
        {
           int temp = a;
           a = b;
           b = temp;
        }
        public void madOperation2 (int[] list, int k, int m)
        {
           int i;
           if (k == m)
           { 
              for (i = 0; i <= m; i++)
              Console.Write ("{0}",list [i]);
              Console.Write (" ");
           }
           else
              for (i = k; i <= m; i++)
              {
                 madOperation1 (ref list [k], ref list[i]);
                 madOperation2 (list, k+1, m);
                 madOperation1 (ref list [k], ref list [i]);
              }
        }
    }
}     
     

    
    

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: