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

Which function is used in the vbscript language to convert the specified expression into a date type value?

890


who will create the object?

1921


I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?

1944


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

949


How will you get the smallest subscript of an array in vbscript?

1318


Which function is used to perform string comparison?

1071


Description.Create

2604


How to Import data from a file (file is on the desktop) to the data table

2008


Mention the rules for using option explicit statement?

936


How to declare an array in vbscript?

1218


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2864


How can constants be declared in the vbscript language?

950


What is the difference between vbscript and vba?

1069


What are the different types of operators and their order of precedence?

991


How will you check that a variable is an array in vbscript?

958