a function that takes an integer array as an argument and
returns the largest value in the array. Use the function in
a program

Answer Posted / abd al-ala camara

<?php
// define function largest()
function largest($numbers) {

foreach ($numbers as $temp) {

$largestNumber = max($numbers);

}

return $largestNumber;

} // end function

$numbers = array(3, 45, 2, 56, 7, 9, 78, 23, 63);
echo largest($numbers); // if you want you can echo or just
use it another function or programe
?>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Enter Values on the Command promt using VB script

1526


How can constants be declared in the vbscript language?

546


What is the difference between vb debugger and the script debugger?

577


Mention what is the main difference between function and sub-procedure?

543


regular expression that will recognize a browser as long as its name property starts with mybrowser

1757






Mention how to assign a date value to a variable?

583


What is the difference between a dictionary and an array?

572


wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......

1483


Anyone have qtp11.0 crack?

2378


Explain about filter expression?

563


what do you mean .ota mobile format

1935


In html file what is an ideal position to include vbscript?

801


write a function to read the items from combobox of Flight reservation & save in excel (QTP)??

2386


How to throw an error in vbscript?

599


Explain about adodb.stream class?

587