# C# | Design a Simple Calculator Using Switch Case Statement

C# | Design a Simple Calculator Using Switch Case Statement The article is a lively article because it contains interesting information and your favorite.

## C# | Design a Simple Calculator Using Switch Case Statement

``````using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DecisionMaking3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Calculator");
Console.WriteLine("----------------------------");
Console.WriteLine("2.Substract");
Console.WriteLine("3.Multiply");
Console.WriteLine("4.Divide");
Console.Write("Enter Choice(1-4):");
int a, b, c;
switch(ch)
{
case 1:
Console.Write("Enter A:");
Console.Write("Enter B:");
c = a + b;
Console.WriteLine("Sum = {0}", c);
break;
case 2:
Console.Write("Enter A:");
Console.Write("Enter B:");
c = a - b;
Console.WriteLine("Difference = {0}", c);
break;
case 3:
Console.Write("Enter A:");
Console.Write("Enter B:");
c = a * b;
Console.WriteLine("Product = {0}", c);
break;
case 4:
Console.Write("Enter A:");
Console.Write("Enter B:");
c = a / b;
Console.WriteLine("Quotient = {0}", c);
break;
default:
Console.WriteLine("Invalid Choice");
break;
}
}
}
}
``````
``````First run:

Calculator
----------------------------
2.Substract
3.Multiply
4.Divide
Enter Choice(1-4):1
Enter A:10
Enter B:20
Sum = 30

Second run:

Calculator
----------------------------
2.Substract
3.Multiply
4.Divide
Enter Choice(1-4):4
Enter A:10
Enter B:20
Quotient = 0

Third run:

Calculator
----------------------------
2.Substract
3.Multiply
4.Divide
Enter Choice(1-4):5
Invalid Choice
``````

## Final Words

I hope you find the article C# | Design a Simple Calculator Using Switch Case Statement uses. The reason is that we have told you all the information through this article in a way that you can understand. And if you have any doubts, you can express your doubts through the comment box. We also ask that you help share this article with your friends.

Hi, I'm Selva a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on: