PHP SWITCH STATEMENT - PHP LESSON 9 STUDENTSBLOG100 - Anna University Multiple Choice Questions

PHP SWITCH STATEMENT - PHP LESSON 9 STUDENTSBLOG100


In switch statements multiple cases are used. Each case contain one condition. The case which is matched with the switch variable will be executed. 

Syntax:
Example:

Output:
Well done
your grade is : B

In the above program, initially we have declared variable grade as B. And totally six cases are introduced with different conditions. In which the variable grade is assigned as B so case B matched and thus case "B" block is executed.

If none of the case is matched, the default block will be executed.

Lesson 8  Previous | Main Page | Next Lesson 10

No comments:

Post a Comment