I know to find the min of 2 arguments you use:
#define ( a , b ) / > a > b ? a : b
But to make 5 do I have to write it the same way I would write a function?
smallest = num1; if (num2 < num1) smallest = num2; if (num3 < num2) smallest = num3; if (num4 < num3) smallest = num4; if (num5 < num4) smallest = num5;
Or do you write it something like this:
#define MIN5(1,2,3,4,5) (MIN2 (1 , MIN2 (2 , MIN2 ( 3 , MIN2 ( 4 , 5 ) ) ) ) )
Any help is greatly appreciated!
This post has been edited by jimblumberg: 10 November 2012 - 08:50 AM
Reason for edit:: Added missing Code Tags, Please learn to use them.