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

namespace ch6_4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public int sumAray(params int[] array)
        {
            int sum = 0;
            foreach (int x in array)
                sum += x;
            return sum;
        }

        private void SumArray_Click(object sender, EventArgs e)
        {
            label1.Text += "Call with 3 parameters : " + sumAray(10, 20, 30);
            label2.Text += "Call with 5 parameters : " + sumAray(20, 30, 40, 50);
        }

    }
}
