Using only standard math operators (+, -, *, /) and functions (absolute value, square root, powers, and so on), give a function that calculates MAX(A,B,C).
Alternate version, for programmers only: using any language (BASIC, C, Excel, whatever) find the maximum of A, B, and C, but be careful when writing the program, because you cannot use the ">" key, for it's broken (thus writing things like IF A>B is impossible...) and you cannot use the "M" key either, for it's also broken (...and writing H=MAX(A,B) is also not possible.)
(In reply to
re: programming solution by Ady TZIDON)
1. Yes, it is.
2. No... this would be terribly inefficient.
But the method to determine Max is dependent on the data type being
evaluated.
For example, many numeric values can be passed on
directly to a numeric coprocessor or the CPU which has an instruction
to determine this.
Early CPUs could have implemented this
(integers) by loading one value into register A and the second value
into register B. Then perform a subtraction (A-B) and store in
register C (or back in register A or B), it doesn't really matter.
Then it would perform a "greater than 0" comparison on the
result. If the answer is true (namely that the difference is
positive), then A is greater, and if the answer is false (the
difference is negative), then B is greater.
Edited on April 21, 2004, 5:01 pm