Question: Check the following pieces of code and then determine whether each piece of code is correct or wrong? A.php function addNumbers($a, $b) { $r = $a + $b; return $a + $b; }

icon
Related questions
Question

please solve parts A, b and C

Question:
Check the following pieces of code and then determine whether
each piece of code is correct or wrong?
A.<?php
function addNumbers($a, $b)
{ $r = $a + $b;
return $a + $b;
}
$n1 = 6;
$n2 = 7;
echo addNumbers($n1, $n2);
B.<?php
C.<?php
?>
function addNumbers($a, $b)
{ $r = $a + $b;
return $a + $b;
}
$result = addNumbers(4, 11);
echo $result;
?>
function zz($a)
{ $y = 1;
$r = $y + 6;
echo $r;
}
zz(4);
echo $y;
?>
Transcribed Image Text:Question: Check the following pieces of code and then determine whether each piece of code is correct or wrong? A.<?php function addNumbers($a, $b) { $r = $a + $b; return $a + $b; } $n1 = 6; $n2 = 7; echo addNumbers($n1, $n2); B.<?php C.<?php ?> function addNumbers($a, $b) { $r = $a + $b; return $a + $b; } $result = addNumbers(4, 11); echo $result; ?> function zz($a) { $y = 1; $r = $y + 6; echo $r; } zz(4); echo $y; ?>
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer