在C语言中,如果下面的变量都是int类型,则输出的结果是( )。
sum=5,p=5;p=sum++,p++,++p;
printf("%d\n",p);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651a.html
点击查看答案
设有以下程序段,则值为6的表达式是( )。
struct st { int n; struct st *next;};
static struct st a[3]={5,&a[1],7,&a[2],9,0 },*p;
p=&a[0];
A. p++->n
B. ++p->n
C. p->n++
D. (*p).n++
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346515.html
点击查看答案
以下程序的输出结果是()。
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf("%ld\n", fun(3)); }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650b.html
点击查看答案
以下不合法的数值常量是()。
A. 011
B. 1e1
C. 8.0E0.5
D. 0xabcd
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651b.html
点击查看答案
以下程序的输出是()。
struct st
{ int x; int *y;} *p;
int dt[4]={ 10,20,30,40 };
struct st aa[4]={ 50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],};
main()
{ p=aa;
printf("%d\n",++(p->x));
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346503.html
点击查看答案
设有 int x=11; 则表达式 (x++ * 1/3) 的值是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650f.html
点击查看答案
有以下程序
#include
main()
{char ch[3][5]={“AAAA”,”BBB”,”CC”};
printf(“%s\n”,ch[1]);
}
程序运行后的输出结果是()。
A. AAAA
B. CC
C. BBBCC
D. BBB
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346513.html
点击查看答案
以下叙述中不正确的是()。
A. 在C中,函数中的自动变量可以赋初值,每调用一次,赋一次初值。
B. 在C中,在调用函数时,实在参数和对应形参在类型上只需赋值兼容。
C. 在C中,外部变量的隐含类别是自动存储类别。
D. 在C中,函数形参可以说明为register变量。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650d.html
点击查看答案
有以下程序
#include
struct ord
{ int x,y;}dt[2]={1,2,3,4};
main()
{
struct ord *p=dt;
printf("%d,",++(p->x)); printf("%d\n",++(p->y));
}
程序运行后的输出结果是()。
A. 1,2
B. 4,1
C. 3,4
D. 2,3
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346502.html
点击查看答案
22.设有以下程序段
int x=0,s=0;
while(!x!=0)s+=++x;
printf("%d",s);
则()。
A. 运行程序段后输出0
B. 运行程序段后输出1
C. 程序段中的控制表达式是非法的
D. 程序段执行无限次
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346508.html
点击查看答案