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
Explain the operator precedence in vb script?
what is the differance between BYVAL,BYREF?
what types of bugs will we find out in banking projects for automation testing?
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
What are the valid scopes of a variable in vbscript?
What is byref and byval parameters in vbscript?
What is loose binding? Why is it not a good practice to use it?
What is the difference between function and procedure?
What is the extension of the vbscript file?
How to replace junk code recorded by QTP with a mall function.
How regexp.execute method works?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
Mention what is the use of option explicit in vbscript?
How will you get the octal value of the given number in vbscript?
Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?