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

Compare java script and vb script?

593


Explain about scrrun.dll in vbscript?

650


Mention how you can call vbscript functions?

585


can anyone tell me the procedure of interview held in applabs

1751


What is the technology used by vb script?

543






Explain the .wsf files?

533


What methods are used to create text files and open text files in the vbscript language?

535


what is the differance between BYVAL,BYREF?

1770


What is the use of option explicit statement?

583


write a program to display configuration of a local system with the help of vb script.

1686


Can anyone send me a vb script function for verifying the functionality of active links on a web page

1600


Explain vbscript in detail?

617


What are the disadvantages of vbscript?

655


How to assign a numeric value to a variable?

620


How to access array data?

545