multiple default labels in one switch

multiple default labels in one switch.

Description


A switch statement contains multiple default labels.

Example


Output


How to fix it ?


Delete one of the default labels to resolve the error.

syntax


switch (<  expression of integer type>) {
case <integer onstant-expression> :
statement(s);
break; /* optional */

case <integer onstant-expression> :
statement(s);
break; /* optional */

/* you can have any number of case statements */
default : /* Optional */
statement(s);
}

See also


Subscribe to our channel.

Leave a Reply

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