当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

(27)有以下程序#include <stdio.h>main(){ int x=1,y=0;if(!x) y++;else if(x==0)if (x) y


(27)有以下程序

#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 ",y);

}

程序运行后的输出结果是

A)3

B)2

C)1

D)0

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • 请阅读下述代码,写出程序执行的结果#include &lt;iostream&gt; using namespace std; class C

  • 请阅读下述代码,写出程序执行的结果#include &lt;iostream&gt; using namespace std; class C

  • (37 )有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;struct A{ int a; char b[1

  • (12 ) 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;void fun (char *str ){

  • (12 ) 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;void fun (char *str ){

  • 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;main(){ printf("%d ",strlen (