What Will Be The Output Of The Following Php Codep Pre Langphp #669
What will be the output of the following PHP code?</p> <pre><code class="language-php" line="1"> <?php function sum($x, $y) { $z = $x + $y; return $z; } echo "5 + 10 = " . sum(7,13) . "<br>"; echo "7 + 13 = " . sum(2,4) . "<br>"; echo "2 + 4 = " . sum(5,10); ?> </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs107 PHP: Hypertext Preprocessor. It can also be found in gs gs107 PHP Functions - PHP Functions - Quiz No.2.
What will be the output of the following PHP code?
<?php function sum($x, $y) { $z = $x + $y; return $z; } echo "5 + 10 = " . sum(7,13) . "<br>"; echo "7 + 13 = " . sum(2,4) . "<br>"; echo "2 + 4 = " . sum(5,10); ?>
5 + 10 = 15 2 + 4 = 6 7 + 13 = 20
7 + 13 = 20 5 + 10 = 15 2 + 4 = 6
5 + 10 = 15 7 + 13 = 20 2 + 4 = 6
5 + 10 = 20 7 + 13 = 6 2 + 4 = 15