What is a switch case explain with example?

switch( expression ) { case value-1: Block-1; Break; case value-2: Block-2; Break; case value-n: Block-n; Break; default: Block-1; Break; } Statement-x; The expression can be integer expression or a character expression . Value-1, 2, n are case labels which are used to identify each case individually.

Sizin İçin Seçtik  How do you write a loop in darts?

Leave a Reply

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