adplus-dvertising
frame-decoration

Question

What will be the output of the following PHP code?
<?php
function addFive($num)
{
    $num += 5;
}
function addSix(&$num)
{
    $num += 6;
}
$orignum = 10;
addFive( &$orignum );
echo "Original Value is $orignum<br />";
addSix( $orignum );
echo "Original Value is $orignum<br />";
?>

a.

Original Value is 15

b.

Original Value is 15
Original Value is 21

c.

Original Value is 15
Original Value is 15

d.

None Of the mentioned

Posted under Functions in PHP PHP

Answer: (b).Original Value is 15
Original Value is 21

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code?

Similar Questions

Discover Related MCQs