The below c program will show the size and range of int 64, in order to use a few methods and constants to find the size and the range of int 64, these two headers are included in the c program file.
#include<stdint.h> #include<limits.h>
The entire program is as follows:-
#include<stdio.h> #include<stdint.h> #include<limits.h> void printDataSize(void); // print int 64 data size void printDataRange(void); // print int 64 data range int main( void ) { printf("Size of int 64:\n"); printDataSize(); printf("Range of int 64:\n"); printDataRange(); return 0; } void printDataSize(void) { printf("%lu bytes\n", sizeof(int64_t)); } void printDataRange(void) { printf("%22lld %22lld\n", LLONG_MIN, LLONG_MAX); }
The above program will show the below outcome:-
Size of int 64: 8 bytes Range of int 64: -9223372036854775808 9223372036854775807
With such a huge range, int 64 is good enough to display most of the integer numbers in the program.