Influencing policy (training slides from Fast Track Impact)
Calculator Program in C#.NET
1. (1) Write a C# Program for Basic Calculator which can
handle addition, subtraction, multiplication, and division.
Source Code:
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Threading.Tasks;
System.Windows.Forms;
namespace Calc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
float number1 , number2 , add , sub , mul ,div;
private void button1_Click(object sender, EventArgs e)
{
number1 = Convert.ToInt32(textBox1.Text);
number2 = Convert.ToInt32(textBox2.Text);
add = number1 + number2;
textBox3.Text = add.ToString();
}