if you are interested to contribute your LAB PROGRAM Please send mail to jkumaron@gmail.com

Switch case statement and default statement in c | Switch case default statement behavior

How to act default statement in the switch case
int sw=5;
int y=2;
Char op=’*’;
case ‘+’ :sw+=y;
case ‘-‘:sw-=y;
Debugging Answer:
Debugging Solution:
Switch case statement it will go to default statement because
It does not match with any other statement. so in the default statement
It will increase there sw value by one

Related post