若有定义:int b[5];则以下对b 数组元素的正确引用是()。
A. *b[5]
B. b+2
C. *(*(b+2))
D. *(b+2)
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651a.html
点击查看答案
以下能正确定义字符串的语句是()。
A. char str[]={"\064"};
B. char str="kx43";
C. char str="";
D. char str[]="\0"
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651c.html
点击查看答案
有以下程序,若运行时从键盘输入:18,11<回车>,则程序的输出结果是( ) 。
main()
{ int a,b;
printf("Enter a,b:"); scanf("%d,%d",&a,&b);
while(a!=b)
{ while(a>b) a -= b;
while(b>a) b -= a;
}
printf("%3d%3d\n",a,b);
}
A. 1 1
B. 2 1
C. 2 2
D. 3 3
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346514.html
点击查看答案
C语言中的标识符只能由字母,数字和下划线三种字符组成,且第一个字符()。
A. 必须为字母
B. 必须为下划线
C. 必须为字母或下划线
D. 可以是字母,数字和下划线中任一字符
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346520.html
点击查看答案
下程序运行后的输出结果是() 。
#include
main()
{ int a;
a=(int)((double)(3/2)+0.5+(int)1.99*2);
printf("%d\n",a);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.html
点击查看答案
有以下程序
#include
struct S
{ int a,b;}data[2]={10,100,20,200};
main()
{ struct S p=data[1];
printf("%d\n",++(p.a));
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346503.html
点击查看答案
设有以下宏定义:
#define N 3
#define Y(n) ( (N+1)*n)
则执行语句:z=2 * (N+Y(5+1));后,z的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346502.html
点击查看答案
有以下程序段
int i,n;
for(i=0;i<8;i++)
{ n=rand()%5;
switch (n)
{ case 1:
case 3:printf("%d\n",n); break;
case 2:
case 4:printf("%d\n",n); continue;
case 0:exit(0);
}
printf("%d\n",n);
}
以下关于程序段执行情况的叙述,正确的是( )。
A. for循环语句固定执行8次
B. 当产生的随机数n为4时结束循环操作
C. 当产生的随机数n为1和2时不做任何操作
D. 当产生的随机数n为0时结束程序运行
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651c.html
点击查看答案
下面程序的输出结果为()。
main()
{ int a,b;b=(a=3*5,a*4,a*5);
printf("%d",b);
}
A. 60
B. 75
C. 65
D. 无确定值
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346509.html
点击查看答案
以下数组定义中不正确的是()。
A. int a[2][3];
B. int b[][3]={0,1,2,3};
C. int c[100][100]={0};
D. int d[3][]={{1,2},{1,2,3},{1,2,3,4}};
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650c.html
点击查看答案