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
Why is the use of exit do or exit for statements within loops discouraged?
How will you convert a string to upper case string using vbscript?
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
Explain about operator precedence in vb script?
Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.
Can u describe what kind of testing are for OTC derivates by banks.
What is the difference between function and procedure?
What is purpose of scripting.filesystemobject class in vbscript?
Explain the filter expression?
Write a code to print numbers from 5 to 0?
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
how to operate webobjects in a webpage using getobject function and then using generic methods?
Mention what is the use of option explicit in vbscript?