fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // firstly, lets take some large number e.g 10000000
  5. int x = 10000000;
  6. printf("1st number - %i", x);
  7. // this number is available, so lets take larger number e.g 1000000000;
  8. int y = 1000000000;
  9. printf("\n2nd number - %i", y);
  10. // this number is also available in an integer, so lets take 10000000000;
  11. // I tried to take int z = 10000000000; but compilier gave error
  12. // that means maximum value less than 10000000000
  13. // I tried to take int a = 4000000000; but compilier gave error
  14. // that means maximum value less than 4000000000
  15. // lets take 2000000000;
  16. int b = 2000000000;
  17. printf("\n5th number - %i", b);
  18. // it means that maximum number is between 2000000000 and 4000000000
  19. // I tried to take int c = 2500000000; but compilier gave error
  20. // that means maximum value less than 2500000000
  21.  
  22. // I tried to take int d = 2200000000; but compilier gave error
  23. // that means maximum value less than 2200000000
  24. int e = 2100000000;
  25. printf("\n8th number - %i", e);
  26. // between 2100000000 and 2200000000
  27. // there was also some errors which were not included
  28.  
  29. int g = 2145000000;
  30. printf("\n10th number - %i", g);
  31. int j = 2147483000;
  32. printf("\n13th number - %i", j);
  33. int l = 2147483647;
  34. printf("\n15th number - %i", l);
  35. printf("\nso the maximum value in an integer is %i", l);
  36. //logically the minimum should be -2147483647, lets check it;
  37. int n = -2147483648;
  38. printf("\n17th number - %i", n);
  39. //however, the minimum value is -2147483648
  40. printf("\nthe minimum value is %i", n);
  41.  
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
1st number - 10000000
2nd number - 1000000000
5th number - 2000000000
8th number - 2100000000
10th number - 2145000000
13th number - 2147483000
15th number - 2147483647
so the maximum value in an integer is   2147483647
17th number - -2147483648
the minimum value is -2147483648