INT_MAX and INT_MIN in climits

What does INT_MAX and INT_MIN actually prints ? Because when I write ( cout<< INT_MAX<<endl; ). It prints 2147483647 and in case eof INT_MIN it prints -2147483648. Now I understand that it is the range from a minimum number to a maximum number that a memory block can store. But the main doubt is that is it a range of int datatype or a float datatype or a double datatype.

Hey @yashsharma4304
This is for int data type

Refer to this:

So if I declare double x = INT_MAX; and then print the value of x, then will it print the range of double.

No
If you know about macros then INT_MAX is a macro
If u dont know what a macro is then assume it as a global variable stroed in climits header file
whcih u are assigning to x here

INT_MAX value is constant

Ok till now I have not learn about macros. I am a newbie to this word. But ok for now I am assuming it as a global variable stored in climits. Thank u.

1 Like