Your SlideShare is downloading. ×
Calculator Program in C#.NET
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Calculator Program in C#.NET

928
views

Published on

Calculator Program in C#.NET Which can Perform Additon , Subtraction , Multiplication , Divison

Calculator Program in C#.NET Which can Perform Additon , Subtraction , Multiplication , Divison

Published in: Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
928
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 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(); }
  • 2. private void button2_Click(object sender, EventArgs e) { number1 = Convert.ToInt32(textBox1.Text); number2 = Convert.ToInt32(textBox2.Text); sub = number1 - number2; textBox3.Text = sub.ToString(); } private void button3_Click(object sender, EventArgs e) { number1 = Convert.ToInt32(textBox1.Text); number2 = Convert.ToInt32(textBox2.Text); mul = number1 * number2; textBox3.Text = mul.ToString(); } private void button4_Click(object sender, EventArgs e) { number1 = Convert.ToInt32(textBox1.Text); number2 = Convert.ToInt32(textBox2.Text); div = number1 / number2; textBox3.Text = div.ToString(); } } } Output:

×