0% found this document useful (0 votes)
2K views1 page

Sxsxxs

The document contains code for a C# console application that takes in two numbers from the user, allows the user to select an arithmetic operation, performs the calculation on the two numbers, and displays the result. The application uses a switch statement to perform addition, subtraction, multiplication, or division based on the user's input and displays the output.

Uploaded by

Sarang Amborkar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views1 page

Sxsxxs

The document contains code for a C# console application that takes in two numbers from the user, allows the user to select an arithmetic operation, performs the calculation on the two numbers, and displays the result. The application uses a switch statement to perform addition, subtraction, multiplication, or division based on the user's input and displays the output.

Uploaded by

Sarang Amborkar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

using using using using

System; System.Collections.Generic; System.Linq; System.Text;

namespace ConsoleApplication2 { class Program { static void Main(string[] args) { System.Console.WriteLine("Enter the first no."); int num1 = int.Parse(Console.ReadLine()); Console.WriteLine("Enter the second no."); int num2 = Convert.ToInt16(Console.ReadLine()); int result=0; Console.WriteLine("Arithmetic Operations"); Console.WriteLine("1.Addition:"); Console.WriteLine("2.Subtraction:"); Console.WriteLine("3.Multiplication"); Console.WriteLine("4.Division"); Console.WriteLine("Enter your choice"); int choice = int.Parse(Console.ReadLine()); switch (choice) { case 1: result = num1 + num2; Console.WriteLine("Addition is:"+ result); break; case 2: result = num1 - num2; Console.WriteLine("Subtraction is:"+result); break; case 3: result = num1 * num2; Console.WriteLine("Multiplication is:"+result); break; case 4: result = num1 / num2; Console.WriteLine("Division is" +result); break; } } } }

You might also like