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

Differentiate javascript and vbscript?

1042


What are the properties of regexp object?

1109


What is the output of a + b in vbscript if a = 5 and b = 10?

3112


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

2629


Which function allows you to instantiate an object given its programmatic identifier or progid?

1034


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

2205


How regexp.execute method works?

1073


When does ‘on click of button’ event gets triggered in the vbscript language?

1021


What is the difference between vb debugger and the script debugger?

1141


Which operator is used to concatenate the 2 values in the vbscript language?

1014


1. How do declare public variable in vb scripts?

2132


How do you declare a variable in vbscript?

1066


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

1046


how to write validation function for date in vb script

2632


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.

2073