[ create a new paste ] login | about

Link: http://codepad.org/fnVxCifU    [ raw code | output | fork ]

C, pasted on Apr 20:
1
2
3
4
5
6
7
8
9
#include <stdio.h>
#include<limits.h> /* include for CHAR_BIT */
int main(){
  int my_int_min = 1U << ((sizeof(int) * CHAR_BIT) - 1);
  int my_int_max = ~0U >> 1;
  printf("INT_MIN  = %d\n", my_int_min);
  printf("INT_MAX  = %d\n", my_int_max);
  return 0;
}


Output:
1
2
INT_MIN  = -2147483648
INT_MAX  = 2147483647


Create a new paste based on this one


Comments: