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 print "VALUE: 2104" on the webpage. In the above program, we created $X, $Y, and $Z initialized with 7, 12, and "VALUE" respectively.
$Z .= $X*$Y+2020;
In the above expression we used compound assignment operator. Now we generalize the expression:
$Z = $Z.($X*$Y+2020); $Z = "VALUE: ".(7*12+2020); $Z = "VALUE: ".(84+2020); $Z = "VALUE: 2104";
Answer 2:
Output:
Explanation:
The above program will print "8" on the webpage. In the above program, we created a variable $X and $Y initialized with 7 and 12.
Let's evaluate the expression:
$Z = ++$X+pow($Y,2)*20 ; $Z = 8+144*20 ; $Z = 8 +2880 ; $Z = 2888 ;
Answer 3:
Output:
Explanation:
The above program will print "8" on the webpage. In the above program, we created two variables $X and $Y initialized with 7 and 3.
Let's evaluate the expression:
$Z = ++$X or $Y; $Z = 8 or 3; $Z = 8;
When we performed "or" operation, if the first condition is true then the second condition will never be checked, that's why 8 is assigned to $Z in the above expression.
Answer 4:
Output:
Explanation:
The above program will generate a syntax error. Because echo() function will not return anything. And we did not use any variable on the left side for assignment.
Answer 5:
Output:
Explanation:
The above program will print "Hello" on the webpage. In the above program, we created variables $X and $Y initialized with 7 and 3.
Let's evaluate the expression:
$RESULT = (++$X or $Y)?("Hello"):("Hiii") ; $RESULT = (1)? ("Hello"):("Hiii") ; $RESULT = "Hello" ;
Then "Hello" will be printed on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer