Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$a = 1; $b = 1; $d = 1;
print ++$a + ++$a+$a++; print $a++ + ++$b; print ++$d + $d++ + $a++;
?>

A. 869

B. 742

C. 368

D. error

Answer: Option A

Solution(By Examveda Team)

Follow the order of post and pre increments.

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

Join The Discussion

Related Questions on Operators and Expressions in php