SlideShare a Scribd company logo
(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();
}
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:

More Related Content

What's hot

AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENTAN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
GbadeboTEkunola
 
Android UI
Android UIAndroid UI
Android UI
nationalmobileapps
 
Presentation on House Rent Management System
Presentation on House Rent Management SystemPresentation on House Rent Management System
Presentation on House Rent Management System
Rihab Rahman
 
Java Swing JFC
Java Swing JFCJava Swing JFC
Java Swing JFC
Sunil OS
 
Visibility control in java
Visibility control in javaVisibility control in java
Visibility control in javaTech_MX
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Edureka!
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
Swapanpreet Kaur
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
DrSonali Vyas
 
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYAPYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
Maulik Borsaniya
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application Development
Syed Absar
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle瑋琮 林
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
Tareq Hasan
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
Sourabh Sahu
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
Shakib Hasan Sumon
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
Muhammad Wajahat Bajwa
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
JIGAR MAKHIJA
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with python
Porimol Chandro
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
 

What's hot (20)

AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENTAN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
 
Android UI
Android UIAndroid UI
Android UI
 
Presentation on House Rent Management System
Presentation on House Rent Management SystemPresentation on House Rent Management System
Presentation on House Rent Management System
 
Java Swing JFC
Java Swing JFCJava Swing JFC
Java Swing JFC
 
Visibility control in java
Visibility control in javaVisibility control in java
Visibility control in java
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYAPYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application Development
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Android Data Persistence
Android Data PersistenceAndroid Data Persistence
Android Data Persistence
 
Php
PhpPhp
Php
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with python
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 

Viewers also liked

Prototyping is an attitude
Prototyping is an attitudePrototyping is an attitude
Prototyping is an attitude
With Company
 
50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)
Heinz Marketing Inc
 
20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content
Barry Feldman
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
Yuan Wang
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
Post Planner
 

Viewers also liked (6)

Prototyping is an attitude
Prototyping is an attitudePrototyping is an attitude
Prototyping is an attitude
 
50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)50 Essential Content Marketing Hacks (Content Marketing World)
50 Essential Content Marketing Hacks (Content Marketing World)
 
20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content20 Ideas for your Website Homepage Content
20 Ideas for your Website Homepage Content
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 

Similar to Calculator Program in C#.NET

Tutorial 6.docx
Tutorial 6.docxTutorial 6.docx
Tutorial 6.docx
KrishnaAntala
 
menu strip - visual basic
menu strip - visual basicmenu strip - visual basic
menu strip - visual basic
Melina Krisnawati
 
Client-server architecture (clientserver) is a network architecture .pdf
Client-server architecture (clientserver) is a network architecture .pdfClient-server architecture (clientserver) is a network architecture .pdf
Client-server architecture (clientserver) is a network architecture .pdf
fabmallkochi
 
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
Jannat Ruma
 
C# p7
C# p7C# p7
JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES Aditya Shah
 
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docxMicrosoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
scroghamtressie
 
Program.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdfProgram.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdf
anandf0099
 
Create a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfCreate a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdf
devangmittal4
 
Ditec esoft C# project
Ditec esoft C# project Ditec esoft C# project
Ditec esoft C# project
K.K.T Madhusanka
 
Ditec esoft C# project
Ditec esoft C# projectDitec esoft C# project
Ditec esoft C# project
K.K.T Madhusanka
 
Vp4
Vp4Vp4
delegates
delegatesdelegates
delegates
Owais Masood
 
Inventory management
Inventory managementInventory management
Inventory managementRajeev Sharan
 
Printing and graphics (asp.net)
Printing and graphics (asp.net)Printing and graphics (asp.net)
Printing and graphics (asp.net)
Ankit Gupta
 
C# p3
C# p3C# p3
in order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdfin order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdf
kalerottnerheissst52
 

Similar to Calculator Program in C#.NET (20)

Tutorial 6.docx
Tutorial 6.docxTutorial 6.docx
Tutorial 6.docx
 
menu strip - visual basic
menu strip - visual basicmenu strip - visual basic
menu strip - visual basic
 
Client-server architecture (clientserver) is a network architecture .pdf
Client-server architecture (clientserver) is a network architecture .pdfClient-server architecture (clientserver) is a network architecture .pdf
Client-server architecture (clientserver) is a network architecture .pdf
 
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)
 
C# p7
C# p7C# p7
C# p7
 
JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES
 
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docxMicrosoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
 
Program.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdfProgram.csusing System; using System.Collections.Generic; usin.pdf
Program.csusing System; using System.Collections.Generic; usin.pdf
 
Hems
HemsHems
Hems
 
Create a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdfCreate a C program which performs the addition of two comple.pdf
Create a C program which performs the addition of two comple.pdf
 
Ditec esoft C# project
Ditec esoft C# project Ditec esoft C# project
Ditec esoft C# project
 
Ditec esoft C# project
Ditec esoft C# projectDitec esoft C# project
Ditec esoft C# project
 
Vp4
Vp4Vp4
Vp4
 
4.C#
4.C#4.C#
4.C#
 
delegates
delegatesdelegates
delegates
 
Inventory management
Inventory managementInventory management
Inventory management
 
C#
C#C#
C#
 
Printing and graphics (asp.net)
Printing and graphics (asp.net)Printing and graphics (asp.net)
Printing and graphics (asp.net)
 
C# p3
C# p3C# p3
C# p3
 
in order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdfin order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdf
 

Recently uploaded

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 

Recently uploaded (20)

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 

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(); }
  • 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: