Skip to main content

WAP to find addition, subtraction, multiplication and division of two numbers using switch case.

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace switch_case
{
Class Program
{
static void main(string[] args)
{
double a, b;
Console.WriteLine("Input first number.");
a= Convert.Todouble(Console.ReadLine());
Cosole.WriteLine("Input second number.");
b= Convert.Todouble(Console.ReadLine());
Console.WriteLine("1.Addition");
Console.WriteLine("2.Subtraction");
Console.WriteLine("3.Multiply");
Console.WriteLine("4.Division");
int c = Convert.ToInt32(Console.ReadLine());
Switch (c)
{
Case 1:
{
Console.WriteLine("Addition of two numbers : {0}", (a+b));
break;
Case 2:
Console.WriteLine("Subtraction of two numbers:{0}", (a-b));
break;
Case 3:
Console.WriteLine("Multiplication of two numbers : {0}",(a*b));
break;
Case 4:
Console.WriteLine("Division of two numbers : {0}", (a/b));
break;
}
Console.ReadLine();
}
}
}

Output:
Input first number.
10
Input second number
5

3
Multiplication of two numbers: 50








Comments

  1. European roulette presents a return-to-player price of 97.3%, whereas the American variation comes 메리트카지노 with an RTP of ninety four.7%. So, before you log into a on line casino to play your favourite video games, it's proper to ask what on line casino sport has one of the best odds. The sport has many further features — for instance, free spins with a multiplier. Furthermore, the online slot will delight you with a wild symbol, an obtainable demo sport mode, and bonus video games. Teen Patti originated in India but is now hugely popular across Southern Asia.

    ReplyDelete

Post a Comment

Popular posts from this blog

Physical variables and transducer

unit 3 Physical Variables and transducers  Sensor Sensors are electrical devices that have the capability of sensing different physical variables. The sensor may be classified on different bases one of them is a physical quantity. Hence on the basis of a physical quantity or physical vibration involved the sensors are classified as: Resistive sensor  The input being measured is transformed into a change in resistance. examples: potentiometer, resistance thermometer, strain gauge, etc. Inductive sensor The input being measured is transformed into a change in resistance. example LVDT. Capacitive Sensor The input being measured is transformed into a change in capacitance. example: capacitive Displacement sensor. On the basis of power supply required: Active Sensor Active sensors are those which do not require an external power supply.  example: thermo-couple Passive Sensor Passive Sensors are those which require a power supply. example: Potentiometer. Physical variables and ...