WorksheetsPHP QUIZ-2
Total questions: 10
Worksheet time: 10mins
What is the correct output of the given code <?php
$NUM1 = 3;
$NUM2 = 4;
$NUM3 = $NUM1 ** $NUM2;
echo $NUM3;
?>
12
81
Garbage Value
None of the above
The "**" operator belongs to which category of operators?
Arithmetic operator
Logical operator
Comparison operator
Conditional operator
Which of the following are comparison operators in PHP?
A. ==
B. !=
C. ===
D. < = >
A and B
C and D
A,B and C
A,B,C and D
What is the Output:
<?php
$color= "red";
echo "$color";
echo "$COLOR";
echo "$Color";
?>
redredred
redred
red
Error
What is the Output?
<?php
#echo "Hello World"
echo "#Hello World";
?>
Hello World #Hello World
Hello World
#Hello World
Error
What is the Output
<?php
$color=red;
echo "$color";
?>
red
$color
No answer
Error
What is the Ouput
<?php
$color1="green";
$color2="yellow";
echo "$color1" + "$color2";
?>
greenyellow
green yellow
Error
0
What is the output?
<?php
define(GREETING, " PHP is a Scripting Language");
echo "$GREETING;
?>
$GREETING
no output
GREETING
PHP is a Scripting Language
<?php
$x=10;
$y=4;
$z=3;
echo ($x % ($y) + $z);
?>
5
3
0
1
What is the Output?
<?php
$four4 =4;
$three3 = 3;
$two2 = 2;
echo " $four4 + $three3 / $two2 - 1"
4.5
7
3.5
Error
