1.

Rewrite the following code using switch caseif($Type=='T')echo "DISCOUNT ON TV";else if($Type=='M')echo "DISCOUNT ON MOBILE PHONE";else if($Type=='C')echo "DISCOUNT ON CAMERAS";elseecho "NO DISCOUNT";

Answer»

switch($Type)

{

case 'T': echo "DISCOUNT ON TV";

break;

case 'M' : echo "DISCOUNT ON MOBILE PHONE";

break;

case 'C' : echo "DISCOUNT ON CAMERAS";

break;

default : echo "NO DISCOUNT";

}



Discussion

No Comment Found

Related InterviewSolutions