MAX
(3)maximum or minimum of two values
#include <sys/param.h> MAX(a, b); MIN(a, b);
LIBRARY
DESCRIPTION
RETURN VALUE
ERRORS
STANDARDS
NOTES
BUGS
EXAMPLES
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h>
int
main(int argc, char *argv[])
{
int a, b, x;
if (argc != 3) {
fprintf(stderr, "Usage: %s <num> <num>\n", argv[0]);
exit(EXIT_FAILURE);
}
a = atoi(argv[1]);
b = atoi(argv[2]);
x = MAX(a, b);
printf("MAX(%d, %d) is %d\n", a, b, x);
exit(EXIT_SUCCESS);
}