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 / 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 |
When to use function procedures and what are its characteristics?
Difference between Do while loop and while wend loop
Explain the extension .hta?
print the array values in ascending order?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
hai all.iam chandu..please let me know how to test a link in QTP when it is changing at run time..and what property we should take while we r using descriptive programming for a link..
How to open excel in vb script?
Write a code to print numbers from 5 to 0?
how to set one column as primary key in QTP and fetch values accordingly
What are the properties of regexp object?
How to get the background color of a weblist?
Mention the environments where vbscript could be run?