Q:
PHP find output programs (switch Statement) | set 2
belongs to collection: PHP Find Output Programs
PHP Find Output Programs
- PHP find output programs (basics) | set 1
- PHP find output programs (basics) | set 2
- PHP find output programs (basics) | set 3
- PHP find output programs (Superglobals) | set 1
- PHP find output programs (conditional statements) | set 1
- PHP find output programs (conditional statements) | set 2
- PHP find output programs (conditional statements) | set 3
- PHP find output programs (switch Statement) | set 1
- PHP find output programs (switch Statement) | set 2
- PHP find output programs (switch Statement) | set 3
- PHP find output programs (Operators) | set 1
- PHP find output programs (Operators) | set 2
- PHP find output programs (Operators) | set 3
- PHP find output programs (Loops) | set 1
- PHP find output programs (Loops) | set 2
- PHP find output programs (Loops) | set 3
- PHP find output programs (Loops) | set 4
- PHP find output programs (Arrays) | set 1
- PHP find output programs (Arrays) | set 2
- PHP find output programs (Arrays) | set 3
- PHP find output programs (User-defined functions) | set 1
- PHP find output programs (User-defined functions) | set 2
- PHP find output programs (User-defined functions) | set 3
- PHP find output programs (String Functions) | set 1
- PHP find output programs (String Functions) | set 2
- PHP find output programs (Number Functions) | set 1
- PHP find output programs (Math Functions) | set 1
- PHP find output programs (Math Functions) | set 2
- PHP find output programs (Date and Time) | set 1
- PHP find output programs (define Constant) | set 1
- PHP find output programs (static variables, classes, methods) | set 1
- PHP find output programs (static variables, classes, methods) | set 2
- PHP find output programs (Regular Expressions) | set 1
- PHP find output programs (Exceptions) | set 1
- PHP find output programs (Exceptions) | set 2
- PHP find output programs (Filters) | set 1
- PHP find output programs (Filters) | set 2
- PHP find output programs (JSON) | set 1
- PHP find output programs (const Keyword) | set 1
- PHP find output programs (Class & Objects) | set 1
- PHP find output programs (Class & Objects) | set 2
- PHP find output programs (Class & Objects) | set 3
- PHP find output programs (Constructors and Destructors) | set 1
- PHP find output programs (Constructors and Destructors) | set 2
- PHP find output programs (Constructors and Destructors) | set 3
- PHP find output programs (Inheritance) | set 1
- PHP find output programs (Inheritance) | set 2
- PHP find output programs (Inheritance) | set 3
Answer1:
Output:
Explanation:
The above program will generate compile-time error because of the below statement:
$var = echo ("Hello");
In the above statement, we tried to assign the value returned by the echo function to the $var variable, which is not possible.
Answer2:
Output:
Explanation:
The above program will print "Three" on the webpage. In the above program, we created a variable $var.
Here, pi() will return 3.1415926535898 and then function intval() convert it into 3 and assigned to $var.
Here, case 3 will execute and print "Three" on the webpage. In PHP we can use continue statements in the switch block.
Answer3:
Output:
Explanation:
The above program will print "Three" on the webpage. In the above program, we created a variable $var.
$var = (int)pi();
Here, pi() will return 3.1415926535898 and then we typecast value returned by function pi() that is 3, assigned to the variable $var.
Here, case 3 will execute and print "Three" on the webpage.
Answer4:
Output:
Explanation:
The above program will print "Zero" on the webpage. In the above program, we created a variable $var.
Here, the value of NULL is 0, then $var is assigned by the 0. Then case 0 will execute and print "One" on the webpage.
Answer5:
Output:
Explanation:
The above program will generate compilation error because we use a colon ":" instead of the semicolon ";" in the below statement,
echo "One":
need an explanation for this answer? contact us directly to get an explanation for this answer