answersLogoWhite

0

This smells like homework, so I'll only give you pseudo-code:

decimal returnLargest(decimal a, decimal b)

is a > b ? then, return a, else, return b;

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Write a function prototype named test that accepts two parameters an integer and character and returns a float?

float test(int, char);


Design a function named max that accepts two integer values as arguments and returns the value that is greater of the two For example if 7 and 12 are passed as arguments to the function the function?

The function already exists in PHP and is even called max(); Otherwise use: function max ($one, $two) { return $one > $two ? $one : $two; }


What is function calling in c plus plus?

Function calling is where your code branches off to execute a function and then returns to the instruction following the call. The function may also return a value that can be stored and/or processed by the code that called it. Functions allow common code to be separated from the code that uses the common code, thus reducing maintenance (the code in the function is written once, rather than every time it is required).


Which take a string as input and find its length?

strlen is the C library function that accepts a pointer to a char array and returns an integer specifying the number of characters (in bytes) of the array. This function is usually not used any more, because it does not support multi-byte characters, such as UTF-8.


How do you Write a function prototype for a function named printStars that accepts no arguments and returns no data?

void printStarts (void);


Write a method header for a method named find that takes a String and a double as parameters and returns an integer?

int find(String str, double d);


How would you write a function prototype for a function named calcAreaReact that accepts two arguments width and length and returns the area.?

double calcAreaRect (double a, double b);


What is the use of void data types?

When a function declares it returns void, it means it does not return anything. Sometimes the function doesn't need to return anything, so using void is convenient. In C: using voidinstead of parameters means 'there's no parameters'


What is the function of plus sign?

The "plus sign" (+) is an operator that, by default, takes the left and right operands as parameters, and returns the sum of both operands as the return value.


The greatest integer function shown below is defined so that it produces the greatest integer or equal to x.?

The greatest integer function, often denoted as (\lfloor x \rfloor), returns the largest integer that is less than or equal to the given value (x). For example, (\lfloor 3.7 \rfloor) equals 3, while (\lfloor -2.3 \rfloor) equals -3. This function effectively "rounds down" any non-integer value to the nearest whole number.


How can I use the scipy differentiation function to calculate the derivative of a mathematical function?

To calculate the derivative of a mathematical function using the scipy differentiation function, you can use the scipy.misc.derivative function. This function takes the mathematical function, the point at which you want to calculate the derivative, and the order of the derivative as input parameters. It then returns the numerical value of the derivative at that point.


Does a function that takes a value or values and performs an operation return a result to the caller?

Not necessarily. A function that accepts one or more arguments may process those arguments but need not return any value to the caller. In this case the function simply returns void.