Integer max value with INT_MAX

Whenever we have to find maximum and minimum limit of various Data types, we may use INT_MAX platform-dependent constants proposed by ANSI. So INT_MAX find out Constant Maximal value which can be stored in an int variable.
Same as Minimum value is calculated by INT_MIN.

Both INT_MAX and INT_MIN constants are defined in limits.h.


#include<limits.h> // for INT_MAX and INT_MIN Constants
int main()
	int maximumValue = INT_MAX;
	printf("Maximum Value : %d\n",maximumValue);

	int minimumValue = INT_MIN;
	printf("Minimum Value : %d",minimumValue);

	return 0;

You may also like...