I try to print the maximum value of int in a program.
Using the following code::
#include <stdio.h>
#include <limits.h>
int main(void) {
printf("%d",INT_MAX);
return 0;
}
The output I get is:: 2147483647
But, when I change my printf statement to printf("%lld",INT_MAX); my output becomes 577732524332023807. INT_MAX value is supposed to be inside the range of long long int, then why is it not able to convert INT_MAX into the correct number in long long int.
Thanks for any help in advance.