有如下程序: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
A.不确定的值
B.2
C.1
D.0
D、0
有如下程序: #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
有如下程序: main() {int a=2,b=一1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是()。
有如下程序______。 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
有如下程序: #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
有如下程序: #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.运行时有可能出错
若有如下程序: main() {int a[][2]={1,2,6,9,11},(*t)[2]; t=a; printf("%d,%d\n",*(t[1]+1), (*t) [1]); } 则程序运行后输出的结果是【 】。
A.5
B.6
C.7
D.8
有两个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!”,则输出结果是【 】。
若有如下程序: 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; } 则程序运行后的输出结果是【 】。
若有如下程序: main() {int x=4,y=3,x=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); } 则程序运行后的输出结果是【 】。