Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$var1 = 1;
echo $var1 = ++$var1 % 2 + ++$var1; 
?>

A. 1

B. 0

C. 2

D. 3

Answer: Option D

Solution(By Examveda Team)

Evaluation done from right to left.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Related Questions on Operators and Expressions in php