选择题 24.  有以下程序:
    #include<stdio.h>
    main()
    { int x=1,y=0;
    if(!x)y++;
    else if(x==0)
    if(x)y+=2;
    else y+=3;
    printf("%d\n",y);
    }
    程序运行后的输出结果是______。
【正确答案】 D
【答案解析】 在if else语句中,else总是与离它最近的if配对。本题中x为1,所以!x为0,所以执行else if语句中的内容,判断(x==0)是否成立,因为x为1,所以条件不成立,所以else if内部的if...else语句不再执行,y的值还是初始值0。