Switch Case in C language
SWITCH CASE =
DEFINITION = Switch Case is a statement in C language. The switch statement in C tests the value of a variable and compares it with multiple cases. Once the case match is found a block of statements associated with that particular case is executed.
SYNTAX = The general syntax for Switch Case is as follows =
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;
KEYWORDS IN SWITCH CASE = switch, case, break, and default.
FLOWCHART OF SWITCH CASE =
Example =
No comments:
Post a Comment