Learning C Language: Part Four

Learning C Language: Part Four

1. Branch Control Statements 1.2 switch..case Statement 1.2.1 Format switch(expression){ case constant_expression1: code_block1; break; case constant_expression2: code_block2; break; case constant_expressionn: code_blockn; break; default: other_branch; break;} 1.2.2 Notes 1. The expression is generally a variable, which can also be a variable expression, and the constant expressions after case represent all possible values of this variable; 2. … Read more