Q:
PHP find output programs (conditional statements) | set 3
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:
In the above program, we defined a constant NUM2 initialized with 2.
$NUM1 = $NUM2 + pow(3,3);
In the above expression, we used $NUM2 instead of NUM2, then the value of $NUM2 will be 0. Then,
$NUM1 = 0 + pow(3,3); $NUM1 = 0 + 27; $NUM1 = 27;
We know that 27 is not completely divisible by 2. Then the condition gets false and "ODD" will be printed on the webpage.
Answer2:
Output:
Explanation:
In the above program, we created a variable $NUM, which is initialized a hexadecimal number 0x0A, the decimal value is 10 corresponding to the 0x0A, that's why "EVEN" will print on the webpage.
Answer3:
Output:
Explanation:
The above program will generate a compilation error because power() is not a built-in function in the PHP. We need to use the pow() function to calculate power.
Answer4:
Output:
Explanation:
In the above program, we created two variable $NUM assigned with expression. The decimal values of 0x0A and 0x010 are 10 and 16 respectively.
$NUM = 0x0A+ sqrt(0x10); $NUM = 10 + 4; $NUM = 14;
Now evaluate below expression:
$VAL = (2*intval(pi())+1)*2; $VAL = (2*3+1)*2; $VAL = (6+1)*2; $VAL = (7)*2; $VAL = 14;
Here, $NUM is equal to $VAL then "www.includehelp.com" will print, after that $NUM>$VAL will false then else part will execute and "Nothing" will print on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer