How to get the largest possible value of integer in C

1 Answer

0 votes
#include <stdio.h>
#include <limits.h>
  
int main(void) 
{ 
    int n = INT_MAX;
    
    printf("%d\n", n); 
    printf("%d\n", n + 1); 

    return 0; 
} 
  
  
  
/*
run:
  
2147483647
-2147483648
  
*/

 



answered May 31, 2020 by avibootz

Related questions

1 answer 145 views
1 answer 137 views
1 answer 125 views
1 answer 148 views
1 answer 117 views
1 answer 165 views
1 answer 102 views
...