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 ch3_3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int num, result;
            bool state;
            num = Convert.ToInt32(textBox1.Text);
            state = (num % 2 == 0) ? true : false;
            result = (state == true) ? num * (num + 1) : num + (num + 1) ;
            label2.Text += (state) ? "Num is even, multiply =  " : "num is odd, sum =  ";
            label2.Text += result.ToString();
        }
    }
}
