Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Output explanation needed (regarding sizeof(int) ) 
Difference between en1 and en2, changed 28 character(s)
Hi guys. ↵
 
↵
~~~~~↵
#include <stdio.h>↵
  int main()↵
   {↵
       if (sizeof(int) > -1)↵
           printf("True");↵
       else↵
           printf("False");↵
   return 0;↵
   }↵
~~~~~↵
↵
↵
This outputs False. If I give any negative value , the output is False. ↵
↵
I don't understand why. ↵
↵
Shouldn't it be 4>-1 ? ↵
↵
If I replace -1 with 0,1,2 or 3, The output is True. ↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English shank_punk 2015-07-13 20:25:04 28
en1 English shank_punk 2015-07-13 20:24:14 403 Initial revision (published)