Borland C++ reference

min

partly corrected

Returns the smaller of two values.

Defined in header <stdlib.h>

Syntax

#include <stdlib.h>
(type) min(a, b);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

min compares two values and returns the smaller of the two. Both arguments and the macro declaration must be of the same type.

Return value

min returns the smaller of two values.

See also

Example

#include <stdlib.h>
#include <stdio.h>

int mainO

   int X = 5, y = 6;
   printfC'The smaller number is %d\n", min(x,y));
   return 0;

Program   output

The smaller number is 5

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.