switch Statement Syntax

switch Statement
When there are several options and we have to choose only one option from the available ones, we can use switch statement. Depending on the selected option , a particular task can be performed. A task represent one or more statements.

Syntax
switch(cindition)
{
case value ://Statements;
break;
case value ://Statements;
break;
.
.
.
default ://Statements
}

Leave a Reply

Your email address will not be published. Required fields are marked *