fork(2) download
  1. #include <iostream>
  2. #include <limits.h>
  3.  
  4.  
  5. int main (void) {
  6. printf ("BITS/CHAR %d\n", CHAR_BIT);
  7. printf ("CHARS/SHORT %d\n", sizeof(short));
  8. printf ("CHARS/INT %d\n", sizeof(int));
  9. printf ("CHARS/LONG %d\n", sizeof(long));
  10. printf ("CHARS/LLONG %d\n", sizeof(long long));
  11. putchar ('\n');
  12.  
  13. printf ("SHORT MIN %d\n", SHRT_MIN);
  14. printf ("SHORT MAX %d\n", SHRT_MAX);
  15. printf ("INT MIN %d\n", INT_MIN);
  16. printf ("INT MAX %d\n", INT_MAX);
  17. printf ("LONG MIN %ld\n", LONG_MIN);
  18. printf ("LONG MAX %ld\n", LONG_MAX);
  19. printf ("LLONG MIN %lld\n", LLONG_MIN);
  20. printf ("LLONG MAX %lld\n", LLONG_MAX);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
BITS/CHAR 8
CHARS/SHORT 2
CHARS/INT 4
CHARS/LONG 4
CHARS/LLONG 8

SHORT MIN -32768
SHORT MAX 32767
INT MIN -2147483648
INT MAX 2147483647
LONG MIN -2147483648
LONG MAX 2147483647
LLONG MIN -9223372036854775808
LLONG MAX 9223372036854775807