Php Objective Questions with Answers for written test exams 1

Question 1
What will the following script output?


$x = 3 - 5 % 3;

echo $x;

?>

A. 2

B. 1

C. Null

D. True

E. 3
Answers 1


Answer B is correct. Because of operator precedence, the modulus operation is

performed first, yielding a result of 2 (the remainder of the division of 5 by 2).

Then, the result of this operation is subtracted from the integer 3.

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---