answersLogoWhite

0

The function already exists in PHP and is even called max(); Otherwise use:

function max ($one, $two)

{

return $one > $two ? $one : $two;

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

What is recursive call in terms of algorithm?

A recursive call in an algorithm is when a function (that implements this algorithm) calls itself. For example, Quicksort is a popular algorithm that is recursive. The recursive call is seen in the last line of the pseudocode, where the quicksort function calls itself. function quicksort('array') create empty lists 'less' and 'greater' if length('array') ≤ 1 return 'array' // an array of zero or one elements is already sorted select and remove a pivot value 'pivot' from 'array' for each 'x' in 'array' if 'x' ≤ 'pivot' then append 'x' to 'less' else append 'x' to 'greater' return concatenate(quicksort('less'), 'pivot', quicksort('greater'))


Program to fnd the numbers are equal in Java script?

To test if two number are equal in JavaScript, we use the == operator and compare them. The below function test if two number (a and b) are equal. The function returns 1 if a is greater, -1 if b is greater, and 0 if the numbers are of equal value. function isEqualTo( a, b ){ if ( a > b ){ return 1; } if (b > a ){ return -1; } return 0; }


Can gravitational acceleration of a body be greater then 10?

Yes if the body is for example near Jupiter


Is there an algorithm which accepts two numbers from the user and displays which of the two numbers are relatively greater?

Algorithm:Given x and y are both numbers, if x is greater than y then return x, otherwise return y.C++ implementation of the algorithm:template T GetMax(T x, T y) { return(x>y?x:y); }


What is the function of transition piece in pipe fittings?

Transition piece is mostly used where there is variation of Wall thickness greater tha 3/16" or the yield strength difference is greater than 20 ksi.

Related Questions

What could be an example of a function with a domain and a range where a is greater than 0 and b is greater than 0?

f(x) = (x)^ (1/2) (i.e. the square root of x)


Can a function have two upper bounds?

Yes, a function can have multiple upper bounds. An upper bound for a function is any value that is greater than or equal to the function's output for all inputs in its domain. For example, if a function ( f(x) ) has an upper bound of 5, then any number greater than 5, such as 6 or 10, is also an upper bound. Thus, there can be infinitely many upper bounds for a given function.


How does an exponential function differ from a power function graphically?

An exponential function of the form a^x eventually becomes greater than the similar power function x^a where a is some constant greater than 1.


What are the standard operators in Excel?

The logical operators in Excel are as follows. < is less than, > is greater than, = is equals. <= is less than or equals and >= is greater than or equals. Not equal to is written as <>.


Is y greater than x 2 a function?

no, but y = x2 is a function


Is sine greater than one?

No angle has a sine function greater than 1.


How do you find the range from the set of domains?

You need to have some idea about the behavior of whatever function you are using. As an example, if your function is f(x) = x2, you probably know that the lowest value this can have is 0 (for x = 0), and that for other values of x, the function will be positive. Also, that the function can achieve any positive value. So, in summary, for the set of real numbers, the function can take on any value greater or equal to zero. As another example, the sine function can only produce values between -1 and 1 (inclusive).


Which numbers are greater than 5.22?

There are infinitely many numbers: for example any number greater than 6, for example.


What is the sine for greater than?

The sign is >. Sine is a trigonometric function.


What does the inc function do in clojure?

Returns a number one greater.


How do you write greater than?

The symbol for greater than is > as for example 8 > 6


What is greater than 1 12?

627 3/4 is greater, for example.