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
Answer 1:
Output:
Explanation:
The above program will generate a compilation error because power() is not a built-in function. To calculate the power of a specified number, we need to use pow() function in PHP.
Answer 2:
Output:
Explanation:
In the above program, we defined two variables $NUM1 and $NUM2 initialized with 16 and "16". Here, we used two operators for comparison.
The equal operator will math 16 and "16", but the identical operator will not match. The result of an equal and identical operator will be 1 if operand matched successfully.
$RESULT = ($NUM1==$NUM2); echo $RESULT.'@';
The above statements will print 1@.
$RESULT = ($NUM1==16); echo $RESULT.'@';
The above statements will print 1#.
$RESULT = ($NUM1===$NUM2); echo $RESULT.'%';
And the condition ($NUM1===$NUM2) will not return anything. Then it will print '%' only.
Then the final output "1@1#%" will be printed on the webpage.
Answer 3:
Output:
Explanation:
In the above program, we created two variables $NUM1 and $NUM2 initialized with 16 and "16".
$RESULT= ($NUM1<>$NUM2)?"HELLO":"HII";
In the above expression, we used conditional operator, here we used NOT operator "<>", then condition gets false, then "HII" will be assigned to $RESULT.
Then "HII" will be printed on the webpage.
Answer4:
Output:
Explanation:
The above program will print 80 on the webpage. In the above program, we created two variables $NUM1 and $NUM2 initialized with 16 and "16" respectively.
Let's evaluate the expression:
Then the final value of $RESULT will be printed on the webpage.
Answer5:
Output:
Explanation:
The above program will print 48 on the webpage. In the above program, we created two variables $NUM1 and $NUM2 initialized with 12 and "13" respectively.
Let's evaluate the expression:
$RESULT= $NUM1 * ((16==$NUM2)?(11>2)?6:5:4); $RESULT= 12 * ((16=="13")?(11>2)?6:5:4); $RESULT= 12 * 4; $RESULT= 48;
Then final value of $RESULT will be printed on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer