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 ...

Introduction To DBMS

 Database Management System  A database is an organized collection of data. A Database Management System is a collection of interrelated data and a set of programs to access those data. The main purpose of DBMS is to provide a way to store and retrieve database information that is both convenient and efficient. Management of data involves both defining structures for the storage of information and providing mechanisms for the manipulation of information. In addition, the database system must ensure safety crashes or attempts at unauthorized access. Applications of Database System Banking: For customer information, accounts, and loans, and banking transactions. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a geographically distributed manner. Terminals situated around the world accessed the central database system through phone lines and other data networks. Credit card transactions: For purchase on credit cards and gener...