未知题型
下列程序的输出结果是______。 int m=10; int fun(int a,int B) { int m=2; return(a*b-m); } main() { int x=7,y=5; printf('%d/n',fun(x,y)%m); }
D.3
- A.1
B.2
C.7
【参考答案】
D
解析:本题考查全局变量和局部变量的区别。在函数fun中的m是局部变量,值为2,在主函数中的m是全局变量,值为10。
点击查看答案
相关考题
-
未知题型
以下程序的输出结果是______。 fun(int**p,int a[2][3]) {**p=a[1][2]; } main() { int a[2][3]=}1,3,5,7,9,11},*p; p=(int*)malloc(sizeof(int)); fun(&p,a) ; printf('%d/n',*p); }D.11
A.9
B.7
C.1 -
未知题型
下列程序的输出结果是______。 char*fun(char*str,int n) { int i; char*p=str; for(i=0;i<10;i++,str++) *str='a'+i; return++p; } main() { char a[10]; printf('%s/n',fun(a,10)); }D.不确定的值
A.ABCDEFGHIJ
B.abcdefghij
C.bcdefghij -
单项选择题
Directions: Each sentence has a word or phrase underlined. There are four words or phrase beneath each sentence. Choose the one word or phrase which would best keep the meaning of the original sentence if it were substituted for the underlined part. (每题10分,共10题) 1. While some economists predict continued recovery in the future, Baily says the only certainty is that banks are unlikely to make the same mistakes - twice. "You know, forecasting's become a very hazardous business, so I don't want to commit myself too much. I don't think we know exactly what's going to happen but it's certainly possible that we could get very slow growth over the next year or two.” (CET6-2016.6) A. do something illegal or bad B. decide to use the money or resources for a particular purpose C. do not want to say what you really think about it or what you are going to do D. decide that you want to have a long-term relationship with someone
