Arithmetic or logical right shifts
Replace 24 with (sizeof(int) - 1) * CHAR_BIT. Otherwise the code would fail on a non-32-bit integer machines. Also, using -1 as a probe makes you independent of the bitness of a system:

return ((-1) &gt;&gt; 1) == (-1);


PS: you don't want to print anything from such a specialized routine.