Use of Break statement in switch statement
Explain the function of break statement in a switch statement with example?
Expert
Switch statement is the selection control statement which is used to handle several choices and move control to a case statements within its body.
Following code shows the example of the use of a switch statement in C#:
switch(choice)
{
case 1:
console.WriteLine("First");
break;
case 2:
console.WriteLine("Second");
default:
console.WriteLine("Wrong choice");
}
The break statement is used at the end of the case statement. Break statement is compulsory in C# and it avoids the fall through of one case statement to other.
Mention the two categories which distinctly classifies the variables of the C# programs.
A Destructor is defined in a class that is developed by using the C# programming language, but the destructor is never executed. Why did this happen?
Describe about the characteristic of Anonymous type?
Explain the types of deployment models which are used in the cloud?
Write name of the class which can be used for converting the data types?
Write the difference between the Literal control and Label control?
How can we programmatically prevent the Combobox from dropping, in the .NET 4.0?
What is meant by the Managed Extensibility Framework?
Distinguish among a Thread and a Process?
State the use of a .disco file?
18,76,764
1959781 Asked
3,689
Active Tutors
1436934
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!