若有如下定义变量:
int k=7,x=12; 则能使值为3的表达式是
()。
A. x%=(k%=5)
B. x%=(k-k%5)
C. x%=k-k%5
D. (x%=k)-(k%=5)
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346508.html
点击查看答案
有以下程序
#include
void fun (char*c,int d)
{*c=*c+1;d=d+1;
printf("%c,%c,",*c,d);
}
void main()
{char b='a',a='A';
fun(&b,a); printf("%c,%c\n",b,a);
}
执行后的输出结果是( )。
A. b,B,b,A
B. b,B,a,A
C. b,b,a,a
D. b,b,A,a
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346517.html
点击查看答案
有以下程序
main()
{union
{char ch[2];
int d;
}s;
s.d=0x4321;
printf("%x,%x\n",s.ch[0],s.ch[1]);
}
在16位编译系统上,程序执行后的输出结果是()。
A. 21,43
B. 43,21
C. 43,00
D. 21,00
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346519.html
点击查看答案
以下程序运行后的输出结果是( ) 。
#include
main()
{int i,j;
for(i=6;i>3;i--) j=i;
printf(“%d%d\n”,i,j);
}
A. 2,3
B. 3,3
C. 3,4
D. 4,5
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346518.html
点击查看答案
以下所列的各函数首部中,正确的是()。
A. void play(var a:integer,var b:integer)
B. void play(int a,b)
C. void play(int a,int b)
D. sub play(a as integer,b as integer)
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346522.html
点击查看答案
有以下程序
#include
int fun()
{ static int x=1;
x*=2;
return x;
}
main()
{ int i,s=1;
for(i=1;i<=3;i++) s*=fun();
printf("%d\n",s);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346500.html
点击查看答案
设x、y、t均为int型变量,则执行语句:x=y=3;t=++x||++y;后,y的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346514.html
点击查看答案
main()
{ int x=3,i;
for(i=0;i<3;i++) printf("%d",f(x));
}
int f(int a)
{ int b=0;
static c=3;
b++;c++;
return(a+b+c);
}
执行此程序后屏幕上显示的结果是()。
A. 8 10 10
B. 7 9 10
C. 8 9 11
D. 8 9 10
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650e.html
点击查看答案
有以下函数
int fun(char *x,char *y)
{ int n=0;
while((*x==*y)&&*x!=’\0’) {x++;y++;n++;}
return n;
}
函数的功能是()。
A. 查找x和y所指字符串中是否有’\0’
B. 统计x和y所指字符串中最前面连续相同的字符个数
C. 将y所指字符串赋给x所指存储空间
D. 统计x和y所指字符串中相同的字符个数
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346510.html
点击查看答案
在以下定义中,标识符p( )。
int (*p)[3];
A. 定义不合法
B. 是一个指针数组名,每个元素是一个指向整数变量的指针
C. 是一个指针,它指向一个具有三个元素的一维数组
D. 是一个指向整型变量的指针
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346519.html
点击查看答案