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 / 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 |
write a vbscrpit to swap values
What is the use of option explicit statement?
What is the purpose of the err object in the vbscript language?
1)How to test whether items in a weblist are in alphabetical order or not?
Explain different types of segment?
which is the bset training centre to learn automation tools?
Write a program to resize an array of 5 elements to 4 elements and display all the elements.
how does vb script help in web page designing? explain with example.
I am running a windows based application.While running the script on QTP ,The Application pop-up an Error Message as "object Disabled" in two different scenarios Scenario 1-->The Application pop-up up a Message for Max Session Reached(as the application is set to hold 2 session and if if crosses the pre-defined limit then the error message pop-up) Scenario 2-->When Network connectivity is disabled the Application screen gets greyed out in colour with no operation possible. Now through Exception handling features in QTP ,we need to do the following For Scenarion 1-->Through Exception handling we need to just accept the Message pop-up in the Application and and resume with the call function as is for Scenario 2--> Through Exception Handling featutes on QTP we need to shut down the client , restart the client and resume the call functions as it is Note: The Application returns an Error Message as "object disabled" in both the cases i.e for pop-up message and when the Apllication getting greyed out due to Network failure how can we enhance the script in such a way that for the same error message retured by the application in two different and how to handle them????
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
How to check the particular window is exist or not with out using check points
write a vb script to display first 5 odd numbers from 1 to 100