Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why is the use of exit do or exit for statements within loops discouraged?

1045


How will you convert a string to upper case string using vbscript?

1002


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

3025


Explain about operator precedence in vb script?

1066


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

2042


Can u describe what kind of testing are for OTC derivates by banks.

2139


What is the difference between function and procedure?

1217


What is purpose of scripting.filesystemobject class in vbscript?

1121


Explain the filter expression?

1089


Write a code to print numbers from 5 to 0?

1130


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2629


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

1011


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.

1838


how to operate webobjects in a webpage using getobject function and then using generic methods?

3107


Mention what is the use of option explicit in vbscript?

995