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
Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..
who will create the object?
how to operate webobjects in a webpage using getobject function and then using generic methods?
Explain about constants in vb script?
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
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.
How can you create an object in vbscript?
How to capture a runtime error in vbscript?
When to use function procedures and what are its characteristics?
Write a code to print numbers from 5 to 0?
What is the purpose of folders object of scripting.filesystemobject class in vbscript?
Explain the adodb.stream class?
How will you convert a string to lower case string using vbscript?
I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..
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