Professional Documents
Culture Documents
Switch Case PDF
Switch Case PDF
Programming in C
Dr. Nivedita Palia
SWITCH CASE
switch(var)// possible values for var
{
case val1: //if var=1 this case executes
stmt;
break;
case val2: //if var=2 this case executes
stmt;
break;
default: //if var is something else this will execute
stmt;
}
Switch Case
// WAP to print day of week , after getting input from user in a variable.
//WAP to construct calculator
END