Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. // CHAR
  6. char CH;
  7. CH = 0;
  8. while (CH >= 0)
  9. {
  10. CH++;
  11. }
  12. CH--;
  13. printf("CH_max = %d\n", CH);
  14.  
  15. CH = 0;
  16. while (CH <= 0)
  17. {
  18. CH--;
  19. }
  20. CH++;
  21. printf("CH_min = %d\n", CH);
  22.  
  23. // SHORT INT
  24. short SH;
  25. SH = 0;
  26. while (SH >= 0)
  27. {
  28. SH++;
  29. }
  30. SH--;
  31. printf("SH_max = %hi\n", SH);
  32.  
  33. SH = 0;
  34. while (SH <= 0)
  35. {
  36. SH--;
  37. }
  38. SH++;
  39. printf("SH_min = %hi\n", SH);
  40.  
  41. //INT
  42. int I;
  43. I = 0;
  44. while (I >= 0)
  45. {
  46. I++;
  47. }
  48. I--;
  49. printf("I_max = %i\n", I);
  50.  
  51. I = 0;
  52. while (I <= 0)
  53. {
  54. I--;
  55. }
  56. I++;
  57. printf("I_min = %i\n", I);
  58.  
  59. //LONG INT
  60. unsigned long int UL;
  61. long int L;
  62. UL = 0;
  63. UL--;
  64. L = UL / 2;
  65. printf("L_max = %li\n", L);
  66. L = L*(-1) - 1;
  67. printf("L_min = %li\n", L);
  68.  
  69. //LONG LONG INT
  70. unsigned long long int ULL;
  71. long long int LL;
  72. ULL = 0;
  73. ULL--;
  74. LL = ULL / 2;
  75. printf("LL_max = %lli\n", LL);
  76. LL = LL*(-1) - 1;
  77. printf("LL_min = %lli\n", LL);
  78.  
  79. return 0;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement