Switch Statements Flashcards
1
Q
what are the labels
A
case1:
case2:
case3: etc
2
Q
how do we know to leave the current statement
A
break;
3
Q
general formula``
A
switch ()
{
case :
break;
case :
break;
default:
break;
}
4
Q
why should breaks be avoided outside of switch statements
A
makes code harder to read
5
Q
what does a continue statement do
A
immediately breaks that iteration of a loop/statement and moves onto next
6
Q
why should continues not be used
A
makes code harder to understadn