int calcRange( int number1, int number2, int number3, int number4 )
{
int[] nums = {number1, number2, number3, number4};
int low = number1;
int high = number1;
for (n=2, n<=4, n++)
{
if (nums[n] > high) high == nums[n];
if (nums[n] < low) low = nums[n];
}
return( high - low );
}
Not compiled or tested or anything, and there's no bounds or error-checking....
BTW, with a few minor mods mine has the advantage of working for ANY SIZED array of int's, once the developer understands the meaning of "general purpose programming" and passes an array instead of a fixed # arguments list!
(Yeah, yeah, I didn't need to put number1 into the array, but for the cost of doing it you get MUCH more readable code....)