Header Ads

C# පාඩම -03 (Calculator)

ඔන්න ඉතිං ඔයාලට 3 වෙනි පෝස්ට් එකත් අරන් ආවා.අද කියලා දෙන්න යන්නෙ කොහොමද පුංචි Calculator එකක් හදා ගන්නෙ කියලා. හැබැයි අද ඉදන් ඔයාලට  පෝස්ට් ලියන්න යන්නෙ නැහැ. මොකද ලොකු වෙලාවක් යනවා. ඒත් තේරෙන සිංහලෙන් කියලා දෙනවා Video එකෙන්. අවුල් තැන් තියෙනවා නම් Comment එකක් දාන්න. ඒ වගේම අනිත් අයටත් බලන්න Share  කරන්න. ඊලඟ එකෙන් හම්බෙමු එහෙනම්.




අද වැඩේ සම්පූර්ණ Source Code එක....



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

        double no1;
        double no2;
        double ans;

        private void btn_Add_Click(object sender, EventArgs e)
        {
            no1 = Convert.ToInt32(txt_no1.Text);
            no2 = Convert.ToInt32(txt_No2.Text);

            ans = no1 + no2;

            lbl_ans.Text = ans.ToString();
        }

        private void btn_sub_Click(object sender, EventArgs e)
        {

            no1 = Convert.ToInt32(txt_no1.Text);
            no2 = Convert.ToInt32(txt_No2.Text);

            ans = no1 - no2;

            lbl_ans.Text = ans.ToString();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btn_mul_Click(object sender, EventArgs e)
        {
            no1 = Convert.ToInt32(txt_no1.Text);
            no2 = Convert.ToInt32(txt_No2.Text);

            ans = no1 * no2;

            lbl_ans.Text = ans.ToString();
        }

        private void btn_Div_Click(object sender, EventArgs e)
        {
            no1 = Convert.ToInt32(txt_no1.Text);
            no2 = Convert.ToInt32(txt_No2.Text);

            ans = no1 / no2;

            lbl_ans.Text = ans.ToString();
        }

        private void btn_Clear_Click(object sender, EventArgs e)
        {
            txt_no1.Clear();
            txt_No2.Clear();
        }
    }
}




Android ඩයල්ස් sms alert service එකට reg වෙලා blog එක update කලසැනින් නොමිලේම sms alert ලබාගැනීමට follow DIALSCREW ලෙස යොදා 40404 sms එකක් යවන්න

No comments:

Powered by Blogger.