recursividad con varios métodos

  class Matematicas_R
    {
        char[] aux;
        int i;
        public int Factorial(int n)
        {
            int f = 1;
            if (n == 0 || n == 1)
                return f;
            else
                f = n * Factorial(n - 1);
            return f;
        }
        public int Sumatoria(int n)
        {
            int f = 1;
            if (n == 0 || n == 1)
            {
                return f;
            }
            else
            {
            f=n+Sumatoria(n-1);
            return f;
        }
      }
        // simple
        //public void Invertir_Num(int n)
        //{
        //    Console.Write(n % 10);
        //    if(n>=10)
        //        Invertir_Num(n/10);
        //}


        // con arreglo
        public int[] Invertir_Num(ref int []n,int num,int tam)
        {
            n[tam--] = (num % 10);
            if (num >= 10)
                Invertir_Num(ref n, num / 10, tam);
            return n;
        }
           
        
        //con cadena caracteres
        public char[] Invertir_letra(string cad,int n)
        {
            if (n == 0)
                aux[i] = cad[n];
            else
            {
                aux[i++] = cad[n];
                Invertir_letra(cad, n);
            }
            return aux;
        }
        //fibonacci
        public int fibonacci(int n)
        {
            int f;
            if (n == 1 || n == 2)
                return 1;
            else
                f = fibonacci(n - 1) + fibonacci(n - 2);
                return f;
        }
    }
}
//---------------------------------------------------------
static void Main(string[] args)
        {
            Matematicas_R numero = new Matematicas_R();
            

            //Console.WriteLine("DAR un numero");            
          

            Console.WriteLine("dar un numero");
            
            int n=Convert.ToInt32(Console.ReadLine());
            int fact = numero.Factorial(n);
            
           

            Console.WriteLine("el numero factorial de  "  +n+ " es :" + fact);
           // Console.WriteLine(numero.fibonacci(n));
            int fi = numero.fibonacci(n);
            Console.WriteLine("\n en fibonacci es :" + fi);
            Console.ReadKey();
        }
    }
}

etiqueta en movimiento

 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        bool band = true;
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (label1.Left < this.ClientSize.Width - label1.Width + 10 && band)
            {
                label1.Left++;
                if (label1.Left == this.ClientSize.Width - label1.Width - 10)
                {
                    band = false;
                }
            }


            if (label1.Left > -10 && !band)
            {
                label1.Left--;
                if (label1.Left == -10)
                {
                    band = true;
                }
            }
        }


        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Start();
            label1.RightToLeft.ToString();
        }
    }
}

como crear un archivo binario

    class Program
    {
        public static void EscribirArchivo(string nomarch)
        {
            FileStream fs = null;
            BinaryWriter bw = null;
            try
            {
                fs = new FileStream(nomarch, FileMode.Create, FileAccess.Write);
                bw = new BinaryWriter(fs);
                Random r = new Random();
                int n =5, i =0;
                int val;
                do
                {
                    
                    val = r.Next(10,100);
                    Console.WriteLine("Dato insertado en el archivo : "+ val);
                    bw.Write(val);
                    i++;
                }while(i < n);
            }
            catch(IOException ex)
            {
                Console.WriteLine("ERROR... "+ ex.Message);
            }
            finally
            {
                if( bw != null)
                {
                    bw.Close();
                    fs.Close();
                }
            }
        }
        public static void LeerArchivo(string nomarch)
        {
            BinaryReader br = null;
            try
            {
                if (File.Exists(nomarch))
                {
                    br = new BinaryReader(new FileStream(nomarch, FileMode.Open, FileAccess.Read));
                    
                    int val;
                    do
                    {

                        val = br.ReadInt32();
                        Console.WriteLine("Dato : " + val);
                    } while (true);
                }
                else
                {
                    Console.WriteLine("Archivo no existe");
                }
            }
            catch (EndOfStreamException )
            {
                Console.WriteLine("Fin del archivo...");
            }
            finally
            {
                if(br != null)
                {
                    //fs.Close();
                    br.Close();
                }
            }
        }
//-------------------------------------------------------------------------------------        static void Main(string[] args)
        {
            
Console.WriteLine("DAR nombre del archivo")
            string archivo = 
Console.ReadLine( );
            EscribirArchivo(archivo);

            LeerArchivo(archivo);
            Console.ReadKey();
        }
    }
}

cola utilizando lista enlazada

class Elemento
    {
        public int val;
        public Elemento next;
        public Elemento(int i)
        {
            val = i;
            next = null;
        }
        public Elemento()
        {
            next = null;
        }
    }
    class Est_de_datos
    {
        Elemento first, last;
        public Est_de_datos()
        {
        }
        public void Agregar(int dato)
        {
            Elemento nuevo;
            nuevo = new Elemento(dato);
            if (last != null)
                last.next = nuevo;
            last = nuevo;
            if (first == null)
                first = nuevo;
        }
        public int Eliminar()
        {
            Elemento temp = new Elemento();
            int d;
            temp = first;
            if (temp == null)
                return 0;
            first = temp.next;
            d = temp.val;
            if (first == null)
                last = null;
            return d;
        }
    }
}
//--------------------------------------------------------------------------------
 public partial class Form1 : Form
    {
        Est_de_datos dato = new Est_de_datos();
        int n = 0;
        int cont = 0;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Random r = new Random();
            if (cont < 5)
            {
                n = r.Next(1, 20);
                label2.Text = n.ToString();
                dato.Agregar(n);

                cont++;

            }
            else
            {
                MessageBox.Show("Se terminaron los datos");
                button1.Enabled = false;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (cont > 0)
            {

                label2.Text = dato.Eliminar().ToString();

                cont--;
            }
            else
            {
                MessageBox.Show("Datos disponibles");

            }
        }
    }
}

pila usando lista enlazada

class Elemento
    {
        public int v;
        public Elemento s;
        public Elemento(int v1, Elemento s1)
        {
            v = v1;
            s = s1;
        }
    }


    class ExaU3
    {
        Elemento e1;
        public ExaU3()
        {
            e1 = null;
        }
        public void metodo1(int v1)
        {
            Elemento nuevo = new Elemento(v1, e1);
            e1 = nuevo;
            
        }
        public int metodo2()
        {
            Elemento naux;
            int v1;
            if (e1 == null)
                return -1;
            naux = e1;
            e1 = naux.s;
            v1 = naux.v;
            return v1;
        }
    }
//-----------------------------------------------------

 public Form1()
        {
            InitializeComponent();
        }
        ExaU3 examen = new ExaU3();
        private void Form1_Load(object sender, EventArgs e)
        {


        }


        private void button1_Click(object sender, EventArgs e)
        {
            examen.metodo1(Convert.ToInt32(textBox1.Text));
        }


        private void button2_Click(object sender, EventArgs e)
        {
            label2.Text = examen.metodo2().ToString();
        }
    }
}

Números primos

class Program
  {
   static bool Es_Primo(int n)
    {
       int div = 2;
       if (n > 0)
     {
       while (div < n)
       {
          int r1 = n % div;
          int r2 = n / div;
          if (r1 == 0)
          return false;
          div++;
        }
       return true;
      }
  return false;
  }
  static void Main(string[] args)
  {
  
      Console.Write("Leer Numero: ");
       int n = Convert.ToInt32(Console.ReadLine());
       if (Program.Es_Primo(n) == true)
       Console.WriteLine(" "+n+ " es primo....");
       else
       Console.WriteLine(" " + n + " No es primo....");
       int cont = 0;
       for (int i = 1; i < 100; i++)
       {
          if (Program.Es_Primo(i) == true)
           {
                cont++;
                Console.WriteLine(" " + i + "");
           }
  
        }
      Console.WriteLine(cont);

  
  Console.ReadKey();

  }
  }

cola circular

namespace ColaCircular_Vis
{
    class Cola_Circular<T>
    {
        T[] datos;
        int tam;
        int P, U;
       
        public Cola_Circular(int n)
        {
            tam = n;
            datos = new T[tam];
            P = U = -1;        
        }


        public Cola_Circular(int n, T x)
        {
            tam = n;
            datos = new T[tam];
            P = U = -1;


            for (int i = 0; i < tam; i++)
            {
                datos[i] = x;
            }
        }
        


        public bool insertar(T dato,DataGridView dgv)
        {
           
            if((U==tam-1)&&(P==0)||(U+1==P))
            
                return false;
            else
                if(U==tam-1)
                    U=0;
            else
                    U++;
            datos[U]=dato;


            
                for (int i = 0; i < tam; i++)
                {
                    dgv[i, 0].Value = datos[i].ToString();
                }
            
            if(P==-1)
                P=0;
            return true;


            
        }


        public bool eliminar(ref T dato, T x,DataGridView dgv)
        {
            int ii, aux = 0;


            if (P == -1)
            {
                U++;
                return false;
            }
            
            dato = datos[P];
            if (P == U)
            {
                P = U = -1;
                P++;
            }
            else
                if (P == tam - 1)
                {
                    datos[P] = x;
                    P = 0;
                }
                else
                {
                    datos[P] = x;
                    P++;
                }
            for (ii = 0; ii < tam-1; ii++)
            {
                datos[ii] = datos[ii + 1];
                aux = ii;
            }
           
                datos[aux+1] = x;
           


            for (int i = 0; i < tam; i++)
            {
                dgv[i, 0].Value = datos[i].ToString();
            }
            
            P--;
            U--;
            return true;
        }


        public bool esta_vacia()
        {
            return (P == -1);
        }


        public bool esta_LLENA()
        {
            return (((U+1)%tam)==P);
        }


    }
}
//----------------------------------------------------------------------------
namespace ColaCircular_Vis
{
    public partial class Form1 : Form
    {
        int tam = 0;
        Cola_Circular<int> cola;
        Cola_Circular<string> c2;
        Cola_Circular<char> c3;
        Cola_Circular<double> c4;
        Cola_Circular<double> c5;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                tam = Convert.ToInt32(textBox1.Text);
                dgv1.RowCount = 1;
                dgv1.ColumnCount = tam;
                //textBox1.Enabled = false;
                //button1.Enabled = false;
                comboBox1.Enabled = true;

            }

            catch
            {
                MessageBox.Show("Ingrese puros números, intente de nuevo");
                textBox1.Text = " ";
                textBox1.Focus();
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            int op = 0;
            
            if (comboBox1.Text == "Int")
            {
                op = 1;
            }

            if (comboBox1.Text == "String")
            {
                op = 2;
            }

            if (comboBox1.Text == "Char")
            {
                op = 3;
            }

            if (comboBox1.Text == "Double")
            {
                op = 4;
            }

            if (comboBox1.Text == "Float")
            {
                op = 5;
            }

            switch (op)
            {
                case 1:
                    cola = new Cola_Circular<int>(tam);
                    button2.Enabled = false;
                    comboBox1.Enabled = false;
                    break;

                case 2:
                    c2 = new Cola_Circular<string>(tam, " ");
                    button2.Enabled = false;
                    comboBox1.Enabled = false;
                    break;

                case 3:
                    c3 = new Cola_Circular<char>(tam, ' ');
                    button2.Enabled = false;
                    comboBox1.Enabled = false;
                    break;

                case 4:
                    c4 = new Cola_Circular<double>(tam);
                    button2.Enabled = false;
                    comboBox1.Enabled = false;
                    break;

                case 5:
                    c5 = new Cola_Circular<double>(tam);
                    button2.Enabled = false;
                    comboBox1.Enabled = false;
                    break;

                default:
                    MessageBox.Show("Solo las opciones mostradas estan disponibles");
                    comboBox1.Text = "";
                    break;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int op = 0;

            if (comboBox1.Text == "Int")
            {
                op = 1;
            }

            if (comboBox1.Text == "String")
            {
                op = 2;
            }

            if (comboBox1.Text == "Char")
            {
                op = 3;
            }

            if (comboBox1.Text == "Double")
            {
                op = 4;
            }

            if (comboBox1.Text == "Float")
            {
                op = 5;
            }

            switch (op)
            {
                case 1:
                    try
                    {
                        int num = Convert.ToInt32(textBox2.Text);
                        if (!cola.insertar(num, dgv1))
                        {
                            MessageBox.Show("Insuficiencia de memoria");
                            button3.Enabled = false;
                        }
                        //button4.Enabled = true;
                        textBox2.Focus();
                        textBox2.Text = " ";
                    }
                    catch
                    {
                        MessageBox.Show("Solo numeros, por favor");
                        textBox2.Focus();
                        textBox2.Text = "";
                    }
                    break;          

                case 2:
                    try
                    {
                        string cad = Convert.ToString(textBox2.Text);
                        if (!c2.insertar(cad, dgv1))
                        {
                            MessageBox.Show("Insuficiencia de memoria");
                            button3.Enabled = false;
                            //button4.Enabled = true;

                        }
                        //button4.Enabled = true;
                        textBox2.Focus();
                        textBox2.Text = "";

                    }

                    catch
                    {
                        MessageBox.Show("Solo cadena de caracteres");
                        textBox2.Text = " ";
                        textBox2.Focus();
                    }
                    break;

                case 3:
                    {
                        try
                        {
                            char a = Convert.ToChar(textBox2.Text);
                            if (!c3.insertar(a, dgv1))
                            {
                                MessageBox.Show("Insuficiencia de memoria");
                                button3.Enabled = false;
                                //button4.Enabled = true;
                            }
                            //button4.Enabled = true;
                            textBox2.Focus();
                            textBox2.Text = "";
                        }
                        catch
                        {
                            MessageBox.Show("Solo caracteres (una sola letra 'a','b'....)");
                            textBox2.Text = "";
                            textBox2.Focus();
                        }
                    }
                    break;

                case 4:
                    {
                        try
                        {
                            double n = Convert.ToDouble(textBox2.Text);
                            if (!c4.insertar(n, dgv1))
                            {
                                MessageBox.Show("Insuficiencia de memoria");

                                button3.Enabled = false;
                                //button4.Enabled = true;
                            }
                            //button4.Enabled = true;
                            textBox2.Focus();
                            textBox2.Text = "";
                        }
                        catch
                        {
                            MessageBox.Show("Solo numeros");
                            textBox2.Focus();
                            textBox2.Text = "";

                        }
                    }
                    break;

                case 5:
                    {
                        try
                        {
                            double m = Convert.ToDouble(textBox2.Text);
                            if (!c5.insertar(m, dgv1))
                            {
                                MessageBox.Show("Insuficiencia de memoria");

                                button3.Enabled = false;
                                //button4.Enabled = true;

                            }

                        }
                        catch
                        {
                            MessageBox.Show("Solo numeros");
                            textBox2.Focus();
                            textBox2.Text = "";

                        }
                        break;
                    }
            }
        }          

        private void button5_Click(object sender, EventArgs e)
        {
            int op = 0;

            if (comboBox1.Text == "Int")
            {
                op = 1;
            }

            if (comboBox1.Text == "String")
            {
                op = 2;
            }

            if (comboBox1.Text == "Char")
            {
                op = 3;
            }

            if (comboBox1.Text == "Double")
            {
                op = 4;
            }

            if (comboBox1.Text == "Float")
            {
                op = 5;
            }

            switch (op)
            {
                case 1:
                    int num = 1;
                    if (!cola.eliminar(ref num, 0, dgv1))
                    {
                         MessageBox.Show("Ya no hay datos a eliminar, inserte nuevos datos");
                        button3.Enabled = true;
                        //button5.Enabled = false;
                    }
                    textBox3.Text = num.ToString();
                    button3.Enabled = true;
                    break;

                case 2:
                    string cad = " ";
                    if (!c2.eliminar(ref cad, "0", dgv1))
                    {
                        MessageBox.Show("Ya no hay datos a eliminar, inserte nuevos datos");
                        button3.Enabled = true;
                        //button5.Enabled = false;
                    }
                    textBox3.Text = cad.ToString();
                    button3.Enabled = true;
                    break;
                
                case 3:
                    char c=' ';
                    if(!c3.eliminar(ref c, '0',dgv1))
                    {
                        MessageBox.Show("Ya no hay datos a eliminar, inserte nuevos datos");
                        button3.Enabled = true;
                        //button5.Enabled = false;
                    }
                    textBox3.Text = c.ToString();
                    button3.Enabled = true;
                    break;

                case 4:
                    double dato = 2;
                    if(!c4.eliminar(ref dato, 0, dgv1))
                    {
                        MessageBox.Show("Ya no hay datos a eliminar, inserte nuevos datos");
                        button3.Enabled = true;
                        //button5.Enabled = false;
                    }
                    textBox3.Text = dato.ToString();
                    button3.Enabled = true;
                    break;

                case 5:
                    double dato2 = 2;
                    if(!c5.eliminar(ref dato2, 0, dgv1))
                    {
                        MessageBox.Show("Ya no hay datos a eliminar, inserte nuevos datos");
                        button3.Enabled = true;
                        //button5.Enabled = false;
                    }
                    textBox3.Text = dato2.ToString();
                    button3.Enabled = true;
                    break;          
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            textBox1.Text = "ESCRIBA EL NUMERO..";
            textBox2.Text = "";
            textBox3.Text = "";
            comboBox1.Text = "";
            for (int i = 0; i < dgv1.ColumnCount; i++)
            {
                dgv1[i, 0].Value = " ";
            }
            button5.Enabled = false;
            button3.Enabled = false;
            button4.Enabled = false;
            textBox1.Enabled = true;
        }
        private void button6_Click(object sender, EventArgs e)
        {
            Close();
        }        
    }
}