ex9_2.c

来自「自己做的常用库和实现的数据结构。public domain.」· C语言 代码 · 共 27 行

C
27
字号
/*
  Ex9_2
  Test if my computer use LOGIC-SHIFT or ARITHMATIC-SHIFT
  my coputer type -- AST 386
*/
 
main()
{
   int bitnum;

    printf("--- If logic-shift--right,\n then left part will be filled with 0\
 no matter the int is positive or negative.\n");
    printf("---- If arithmatic-shift-right\n then left-part will be filled with\
 sign-bit.---\n");

    bitnum = ~0 >> 1;

    if (bitnum < 0)
    {
        printf("~0>>1=%d\n",~0>>1);
        printf(" This machine using arithmatic-shift-right!\n");
    }
    else
        printf(" This machine using logic-shift-right!\n");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?