Php Objective Questions with Answers for written test exams 73

Question 73
The following PHP script is designed to subtract two indexed arrays of numbers.

Which statement is correct?


$a = array(5, 2, 2, 3);

$b = array(5, 8, 1, 5);

var_dump(subArrays($a, $b));

function

subArrays($arr1,

$arr2)

{

$c = count($arr1);

if

($c != count($arr2))

return

null;

for($i = 0;

$i < $c;

$i++)

$res[$i]

$arr1[$i] - $arr2[$i];

return $res;

\}

?>

A. The script is valid.

B. Assignments must be made on a single line.

C. It has too many linefeed characters between statements.

D. No, the script is missing curly braces.

E. Yes it is valid, but the script will not work as expected.
Answers 73


B

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---