switch

switch

If you want test value of a variable result of an expression then you can use switch()

If first case value is not match with switch(variable) variable then it chech next case. That case match with switch(variable) variable which statement will be execute after execution switch statement will be terminate.

Syntax

switch( variable/expression ){
case value-1:
/* code here*/
break;
case value-2:
/* code here*/
break;
case value-3:
/* code here*/
break;
case value-4:
/* code here*/
break;
---------------
---------------
default:
/* code here*/
break;
}

See Output

See Output

About Us

Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.

Services

Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.


Terms of Use

comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.

Privacy policy

comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.


Sitemap

sitemap

copyright © 2023