有以下程序
fun(int x,int y){return(x+y);}
main()
{int a=1,b=2,c=3,sum;
sum=fun((a++,b++,a+b),c++);
printf("%d\n",sum); }
执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651c.html
点击查看答案
有以下程序
#include
# include
char *fun(char *t)
{
char *p=t;
return(p+strlen(t)/2);
}
void main()
{
char *str="abcdefgh";
str=fun(str);
puts(str);
}
执行后的输出结果是( )。
A. efgh
B. abcd
C. bcde
D. cdef
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346500.html
点击查看答案
有以下程序
main()
{int a=0,b=0,c=0,d=0;
if(a=1) b=1;c=2;
else d=3;
printf("%d,%d,%d,%d\n",a,b,c,d);
}
程序输出()。
A. 0,1,2,0
B. 0,0,0,3
C. 1,1,2,0
D. 编译有错
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346511.html
点击查看答案
8、 有以下程序
struct STU{
char name[10];
int num;
};
void f1(struct STU c)
{ struct STU b={"LiSiGuo",2042};
c=b;}
void f2(struct STU *c)
{ struct STU b={"SunDan",2044};
*c=b;
}
main( )
{ struct STU a={"YangSan",2041},b={"WangYin",2043};
f1(a);f2(&b);
printf("%d %d\n",a.num,b.num);}
执行后的输出结果是 ()。
A. 2041 2044
B. 2041 2043
C. 2042 2044
D. 2042 2043
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346503.html
点击查看答案
有以下程序
main()
{int a=1,b=3,c=5;
int *p1=&a,*p2=&b,*p=&c;
*p=*p1*(*p2);
printf("%d\n",c);
}
执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346500.html
点击查看答案
有以下程序段
struct st
{int x;int *y;}*pt;
int a[]={1,2},b[]={3,4};
struct st c[2]={10,a,20,b};
pt=c;
以下选项中表达式的值为11的是()。
A. *pt->y
B. pt->x
C. ++pt->x
D. (pt++)->x
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346529.html
点击查看答案
在调用函数时,如果实参是简单变量,它与对应形参之间的数据传递方式是()。
A. 地址传递
B. 单向值传递
C. 由实参传给形参,再由形参传回实参
D. 传递方式由用户指定
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034650a.html
点击查看答案
有以下程序
main()
{int k=5,n=0;
do
{switch(k)
{case 1: case 3:n+=1; break;
default:n=0;k--;
case 2: case4:n+=2;k--;break;}
printf(“%d”,n);
}while(k>0&&n<5);}
程序运行后的输出结果是()
A. 2345
B. 235
C. 23456
D. 2356
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346507.html
点击查看答案