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
Which function is used in the vbscript language to convert the specified expression into a date type value?
who will create the object?
I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
How will you convert a string to upper case string using vbscript?
How will you get the smallest subscript of an array in vbscript?
Which function is used to perform string comparison?
Description.Create
How to Import data from a file (file is on the desktop) to the data table
Mention the rules for using option explicit statement?
How to declare an array in vbscript?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks
How can constants be declared in the vbscript language?
What is the difference between vbscript and vba?
What are the different types of operators and their order of precedence?
How will you check that a variable is an array in vbscript?