In this example, i’ll show you how to use switch case for a range of number in C#. Example: C# static void Main(string[] args) { Console.Write("Number : "); int number=Convert.ToInt32(Console.ReadLine()); switch (number) {...
Tag - C# Switch Case Examples
Check Even or Odd Number Using switch case in C#
In this example, i’ll show you How to check even or odd number using switch case in C# Console App. C# Code: C# static void Main(string[] args) { int num; //Reading a number from user Console.Write("Enter any number to...
Create Simple Calculator using Switch Case in C#
In this example, i’ll show you How to create simple calculator using switch-case in C# Console App. C# Code: C# static void Main(string[] args) { int num1; int num2; string operand; float answer; Console.Write("Please enter...
Print Day of Week Name Using switch case in C#
In this example, i’ll show you How to Print day of week name using switch-case in C# Console App. C# Code: C# static void Main(string[] args) { int weeknumber; //Reading week no from user Console.WriteLine("Enter week...
Print Number of Days in a Month Using switch case in C#
In this example,i’ll show you How to print number of days in a month using switch case in C# Console App. C# Code: C# static void Main(string[] args) { int monthnumber; //Reading a month number from user Console...
Change PictureBox Image Using ComboBox in C#
In this example, i’ll show you how to change image using ComboBox in C# Windows Form App. Step 1: Create a windows application and design the form as follows. Open Visual Studio ->File -> New Project ->Visual C#...
Switch Examples in C#
What is a Switch Statement? A switch statement tests the value of a variable and compares it with multiple cases. Once the case match is found, a block of statements associated with that particular case is executed. Each case in...
Currency Converter Source Code in C#
In this article, we will create a C# Program to perform Currency Conversion. You will also like this: Dollar / Euro Currency Exchange Rate Convertor in C# using JSON C# Code: C# class Program { public static void Main() { int...
C# Program to Make a Calculator using Switch Case
In this example we will create a simple calculator that performs addition, subtraction, multiplication and division based on the user input. Output: C# Code: C# class Program { static void Main(string[] args) { double num1...
Get Month Name From Month Number – C#
In this article we will learn how to convert month number to a month name in C# Console Application with switch case statement.