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 237 views
1 answer 218 views
1 answer 221 views
1 answer 233 views
1 answer 199 views
1 answer 247 views
1 answer 195 views
...