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.
What is meant by DLR (Dynamic Language Runtime)?
What are literals and name the different types of literals in visual basic?
Specify the function of the “SizeMode” property of the PictureBox control?
What is the duration for items stored in the ViewState?
Web form belongs to which class in a .NET Framework class hierarchy?
Explain some of the versions of .NET?
Write difference between an Abstract class and an Interface.
Describe the features of Chart control.
Describe the term Address, Binding and contract for WCF Service?
Write about Windows Azure operating system.
18,76,764
1938121 Asked
3,689
Active Tutors
1425491
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!