C Min Max Values: Find INT_MIN & INT_MAX

In C language, you can use the header file from the standard library to obtain the minimum and maximum values of integer types.

For example, to obtain the minimum and maximum values of an int type, you can use the following code:

#include <stdio.h>
#include <limits.h>

int main() {
    printf("Minimum value of int: %d\n", INT_MIN);
    printf("Maximum value of int: %d\n", INT_MAX);

    return 0;
}

Similarly, to obtain the minimum and maximum values for other integer types, one can use corresponding macros, such as CHAR_MIN and CHAR_MAX which represent the minimum and maximum values for the char type.

bannerAds