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
Differentiate javascript and vbscript?
What are the properties of regexp object?
What is the output of a + b in vbscript if a = 5 and b = 10?
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
Which function allows you to instantiate an object given its programmatic identifier or progid?
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
How regexp.execute method works?
When does ‘on click of button’ event gets triggered in the vbscript language?
What is the difference between vb debugger and the script debugger?
Which operator is used to concatenate the 2 values in the vbscript language?
1. How do declare public variable in vb scripts?
How do you declare a variable in vbscript?
What are the different types of operators and their order of precedence?
how to write validation function for date in vb script
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.