重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 考研
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[单选题]

有如下程序:main(){ int n={0,0,0},i,k=2;for(i=0;i&printf("%d\n",n【k】););}该程序的输出结果是

A.不确定的值

B.2

C.1

D.0

答案

D、0

更多“有如下程序:main(){ int n={0,0,0},i,k=2;for(i=0;i&printf("%d\n",n【k】););}该程序的输出结果是”相关的问题

第1题

有如下程序:#include<stdio.h>main(){int a=2,b= -1,c=2; if(a<b) if(b<0)c=0; elsec++; printf(

有如下程序: #include <stdio.h> main() { int a=2,b= -1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是

A.0

B.1

C.2

D.3

点击查看答案

第2题

有如下程序: main() {int a=2,b=一1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\

有如下程序: main() {int a=2,b=一1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是()。

点击查看答案

第3题

有如下程序______。 long fib (int n) { if(n>2) returb(fib(n-1)+fib(n-2)); else return(2); }

有如下程序______。 long fib (int n) { if(n>2) returb(fib(n-1)+fib(n-2)); else return(2); } main() {printf("%d\n",fib(3));} 该程序的输出结果是______。

A.2

B.4

C.6

D.8

点击查看答案

第4题

有如下程序:#include<iostream>using namespace std;class Test{public:Test(){n+=2;}~Test(){n-

有如下程序: #include<iostream> using namespace std; class Test{ public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行后的输出结果是()

A.n=0

B.n=1

C.n=2

D.n=3

点击查看答案

第5题

有如下程序:#include <iostream>using namespace std;int main(){ int *p; *p = 9;cout << "The

有如下程序: #include <iostream> using namespace std; int main() { int *p; *p = 9; cout << "The value at p: " << *p; return 0; } 编译运行程序将出现的情况是()。

A.编译时出现语法错误,不能生成可执行文件

B.运行时一定输出:The value at p:9

C.运行时一定输出:The value at p:*9

D.运行时有可能出错

点击查看答案

第6题

若有如下程序: main() {int a[][2]={1,2,6,9,11},(*t)[2]; t=a; printf("%d,%d\

若有如下程序: main() {int a[][2]={1,2,6,9,11},(*t)[2]; t=a; printf("%d,%d\n",*(t[1]+1), (*t) [1]); } 则程序运行后输出的结果是【 】。

点击查看答案

第7题

有如下程序 #include<iostream.h> #define N2 #define M N+1 #define NUM 2*M+1 void main() { int i; for(i=1,i<= NUM;i++) cout<<i;} 该程序中的for循环执行的次数是

A.5

B.6

C.7

D.8

点击查看答案

第8题

有两个C程序文件T18.c和myfun.c同在VC系统目录(文件夹)下,其中T18.c文件如下: include <st

有两个C程序文件T18.c和myfun.c同在VC系统目录(文件夹)下,其中T18.c文件如下: include <stdio.h> include "myfun.c" main() { fun(); prinff("\n"); } myfun.c文件如下: void fun() { char s[80],c;int n=0; while((c=getchar())! :\n) s[n++] =c; n--; while (n>=0) prinff("%c" , s [n--] ); } 当编译连接通过后,运行程序T18时,输入"Thank!”,则输出结果是【 】。

点击查看答案

第9题

若有如下程序: main() { int x=4,y=1; printf("%d\n",sub(x,sub(x,y))); }

若有如下程序: main() { int x=4,y=1; printf("%d\n",sub(x,sub(x,y))); } sub(int i,int j) { static int a=0; int b=2; a+=i+b; b+=j+a; } 则程序运行后的输出结果是【 】。

点击查看答案

第10题

若有如下程序: main() {int x=4,y=3,x=2,t; t=x<y<z; printf("%d\n",t);} 则程序运行

若有如下程序: main() {int x=4,y=3,x=2,t; t=x<y<z; printf("%d\n",t);} 则程序运行后的输出结果是【 】。

点击查看答案

第11题

若有如下程序: main() {int x=4;y=3,Z=2,t; t=x<y<z; printf("%d\n",t); }

若有如下程序: main() {int x=4;y=3,Z=2,t; t=x<y<z; printf("%d\n",t); } 则程序运行后的输出结果是【 】。

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝