0% found this document useful (0 votes)
12 views

Switch Case Construct

Uploaded by

Angel Limbo
Copyright
© © All Rights Reserved
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)
12 views

Switch Case Construct

Uploaded by

Angel Limbo
Copyright
© © All Rights Reserved
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 System;

namespace switch_case_limbo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the first number: ");
int first_limbo = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the second number: ");
int second_limbo = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the operator: ");
string operator_limbo = Console.ReadLine();
switch (operator_limbo)
{
case "+":
int sum_limbo = first_limbo + second_limbo;
Console.WriteLine("THE SUM IS " + sum_limbo);
break;
case "-":
int diff_limbo = first_limbo - second_limbo;
Console.WriteLine("THE DIFFERENCE IS " + diff_limbo);
break;
case "*":
int product_limbo = first_limbo * second_limbo;
Console.WriteLine("THE PRODUCT IS " + product_limbo);
break;
case "/":
int qoutient_limbo = first_limbo / second_limbo;
Console.WriteLine("THE QOUTIENT IS " + qoutient_limbo);
break;
case "%":
int remainder_limbo = first_limbo % second_limbo;
Console.WriteLine("THE REMAINDER IS" + remainder_limbo);
break;
case "AVE":
int ave_limbo = (first_limbo + second_limbo) / 2;
Console.WriteLine("THE AVERAGE IS " + ave_limbo);
break;
default:
Console.WriteLine("INVALID OPERATOR");
break;
}
}
}
}

You might also like