Syntax
#include <stdlib.h> type min(type a, type b);Description
min compares two values and determines the smaller of the two. The data type can be any arithmetic data type, signed or unsigned. The type must be the same for both arguments to min.
Note: Because min is a macro, if the evaluation of the arguments contains side effects (post-increment operators, for example), the results of both the side effects and the macro will be undefined.
min returns the smaller of the two values.
#include <stdlib.h> #include <stdio.h> int main(void) { int a = 10; int b = 21; printf("The smaller of %d and %d is %d\n", a, b, min(a, b)); return 0; /**************************************************************************** The output should be: The smaller of 10 and 21 is 10 ****************************************************************************/ }Related Information