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.
Briefly explain the use of a Panel control? And also state whether it displays during runtime?
State the values that can be allocated to the DialogResult property of the Button control?
What are the chief built in objects in Asp.net?
Explain about the DataContext class and also how it is related to the LINQ?
Specify the statement which replaces the multiple if-else statements in the code?
Write the name of namespaces which are required to allow the use of the databases in the ASP.NET pages?
Differentiate between authorization and authentication?
Write the name of two new properties that are further added in an ASP.NET 4.0 Page class?
Write three general properties of every validation controls?
State various implementations of the LINQ?
18,76,764
1948309 Asked
3,689
Active Tutors
1446863
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!