若有定义: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. 在C程序中,每行中只能写一条语句
B. 若a是实型变量,C程序中允许赋值a=10,因此实型变量中允许存放整型数
C. C程序中,无论是整数还是实数,都能被准确无误地表示
D. 在C程序中,%是只能用于整数运算的运算符
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651f.html
点击查看答案
在嵌套使用if语句时,C语言规定else总是()。
A. 和之前与其具有相同缩进位置的if配对
B. 和之前与其最近的if配对
C. 和之前与其最近的且不带else的if配对
D. 和之前的第一个if配对
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346508.html
点击查看答案
有以下程序
#include
void fun(int *s)
{ static int j=0;
do
{ s[j]+=s[j+1];
}while(++j<2);
}
void main()
{ int k,a[10]={1,2,3,4,5};
for(k=1;k<3;k++)
fun(a);
for(k=0;k<5;k++)
printf("%d",a[k]);
}
执行后的输出结果是( )。
A. 35756
B. 23445
C. 35745
D. 12345
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346518.html
点击查看答案
有以下程序
#include “stdio.h”
fun(int x, int y){ return (x+y); }
void 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-6c48-c089-2897e0346511.html
点击查看答案
有如下程序
main()
{ char ch[2][5]={"6937","8254"},*p[2];
int i,j,s=0;
for(i=0;i<2;i++)p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>'\0';j+=2)
s=10*s+p[i][j]-'0';
printf("%d\n",s);}
该程序的输出结果是()。
A. 69825
B. 63825
C. 6385
D. 693825
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650c.html
点击查看答案
有以下程序
#include
int fun (int x,int y)
{ if (x!=y) return ((x+y)/2);
else return (x);
}
main()
{ int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}
程序运行后的输出结果是 ()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346523.html
点击查看答案
有以下程序
main()
{char s[ ]={ "aeiou"},*ps;
ps=s; printf("%c\n",*ps+4);}程序运行后的输出结果是()。
A. a
B. e
C. u
D. 元素s[4]的地址
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346503.html
点击查看答案
有以下程序
main()
{ int i, j;
for(j=10;j<11;j++)
{ for(i=9;i<=j-1;i++)printf("%d",j);
}
}
输出结果是()。
A. 11
B. 10
C. 9
D. 10 11
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346512.html
点击查看答案
执行下列程序时输入123<空格>456<空格>789<回车> 输出结果是 ()。
main()
{ char s[100]; int c, i;
scanf("%c",&c); scanf("%d",&i); scanf("%s",s);
printf("%c,%d,%s\n",c,i,s);
}
A. 123456789
B. 1456789
C. 1,23,456,789
D. 1,23,456
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346522.html
点击查看答案