以下不合法的数值常量是()。
A. 011
B. 1e1
C. 8.0E0.5
D. 0xabcd
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034651b.html
点击查看答案
以下叙述正确的是()。
A. C程序中各函数之间既允许直接递归调用,也允许间接递归调用
B. C程序中各函数之间不允许直接递归调用,也不允许间接递归调用
C. C程序中各函数允许直接递归调用,不允许间接递归调用
D. C程序中各函数之间不允许直接递归调用,允许间接递归调用
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346511.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
点击查看答案
有以下程序
#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
点击查看答案
若有程序段:
x=99;
while(x-2) x--;则循环结束时,x=( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651f.html
点击查看答案
现有程序完成a、b两个值的交换,空白处正确的答案应该是( )。
main()
{int a,b,t;
t=b ;
b=a ;
________ ;
}
A. a=b
B. a=t
C. b=t
D. t=a
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034650d.html
点击查看答案
#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。
A.
a
b
c
d
B. a c b d
C. a b c d
D. d
c
b
a
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346508.html
点击查看答案
以下程序调用findmax函数返回数组中的最大值
findmax(int *a,int n)
{ int *p,*s;
for(p=a,s=a; p-a
if (______) s=p;
return(*s);
}
main()
{ int x[5]={12,21,13,6,18};
printf("%d\n",findmax(x,5));
}
在下划线处应填入的是()。
A. p>s
B. *p>*s
C. a[p]>a[s]
D. p-a>p-s
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346511.html
点击查看答案
下列对字符串的定义中,错误的是( )。
A. char str[7] = "FORTRAN";
B. char str[] = "FORTRAN";
C. char *str = "FORTRAN";
D. char str[] = {'F','O','R','T','R','A','N',0};
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346514.html
点击查看答案
有以下程序
void change(int k[ ]){k[0]=k[5];}
main()
{int x[10]={1,2,3,4,5,6,7,8,9,10},n=0;
while(n<=4) {change(&x[n]);n++;} for(n=0;n<5;n++) printf("%d",x[n]);printf("\n"); }
程序运行后输出的结果是()。
A. 678910
B. 13579
C. 12345
D. 62345
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346501.html
点击查看答案