Speak up! Is there a function in language C that takes the maximum / minimum value of an integer?
Speak up! Is there a function in language C that takes the maximum / minimum value of an integer?
There is no function, but there are macros defined in the limits.h
header of the standard in> C. Example code that prints the minimum and maximum values of an integer:
#include <stdio.h>
#include <limits.h>
int main() {
printf("Menor valor de um inteiro: %d\n", INT_MIN);
printf("Maior valor de um inteiro: %d\n", INT_MAX);
return(0);
}
See running on Ideone .