using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        
        public void myfunc(out int s,ref int x, int y)
        {
            s = x + y + 10;
            x++; y++;
        }
        public void myfunc(out int s,ref int x, int y, int z)
        {
            s = x + y + z;
            x++; y++;
        }
        public long myfunc(int x, int y)
        {
            return (x + y);
        }
        public double  myfunc(double  x, double  y)
        {
            return (x + y);
        }
        public long myfunc(params int[] n)
        {
            long s = 0;
            for (int i = 0; i < n.Length; i++)
                s += n[i];
            return (s);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int a = 10, b = 20, c, d = 30;
            double f = 1, v = 2;
            myfunc(out c, ref a, b);
            MessageBox.Show(a.ToString() + "\n" + b.ToString() + "\n" + c.ToString());
            myfunc(out c, ref a, b, d);
            MessageBox.Show(a.ToString() + "\n" + b.ToString() + "\n" + c.ToString());
            MessageBox.Show(myfunc(a,b).ToString());
            MessageBox.Show(myfunc(f, v).ToString());
            MessageBox.Show(myfunc(1,2,3,4,5,6,7).ToString());            
        }
    }
}
