Below is the program that will perform basic arithmetic operations inn C# using windows form application
Below is the design view of the project.
and here is the source code for the same:
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 basic_opr_windows_app_demo1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int a = Int32.Parse(textBox1.Text);
int b = Int32.Parse(textBox2.Text);
int c = a + b;
textBox3.Text = c.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
int a = Int32.Parse(textBox1.Text);
int b = Int32.Parse(textBox2.Text);
int c = a - b;
textBox3.Text = c.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
int a = Int32.Parse(textBox1.Text);
int b = Int32.Parse(textBox2.Text);
int c = a * b;
textBox3.Text = c.ToString();
}
private void button4_Click(object sender, EventArgs e)
{
int a = Int32.Parse(textBox1.Text);
int b = Int32.Parse(textBox2.Text);
int c = a / b;
textBox3.Text = c.ToString();
}
}
}
Comments
Post a Comment