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
How to Enter Values on the Command promt using VB script
How can constants be declared in the vbscript language?
What is the difference between vb debugger and the script debugger?
Mention what is the main difference between function and sub-procedure?
regular expression that will recognize a browser as long as its name property starts with mybrowser
Mention how to assign a date value to a variable?
What is the difference between a dictionary and an array?
wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......
Anyone have qtp11.0 crack?
Explain about filter expression?
what do you mean .ota mobile format
In html file what is an ideal position to include vbscript?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
How to throw an error in vbscript?
Explain about adodb.stream class?