5.在while( )语句中的e与下面条件表达式等价的是( )。
A. e==0
B. e==1
C. e!=1
D. e!=0
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-9618-c003-bc7499099f00.html
点击查看答案
27.已有定义“char ch1[10]={0},ch2[10]="books";”,则能将字符串"books"赋给数组ch1保存的表达式是( )。
A. ch1="books";
B. strcpy(ch2, ch1);
C. ch1=ch2;
D. strcat(ch1, ch2);
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-0160-c003-bc7499099f00.html
点击查看答案
12. 若函数中有定义语句:“int n;”,则()。
A. 系统将自动给n赋初值0
B. 系统将自动给n赋初值-1
C. 变量n中的值无定义
D. 变量n没有值
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-5010-c003-bc7499099f01.html
点击查看答案
14.以下表示中,不能用作C语言常量的是( )。
A. 0UL
B. (long)123
C. 1e0
D. '\x2a'
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-57e0-c003-bc7499099f00.html
点击查看答案
4.下面程序的功能是:根据下列公式计算cos( )的近似值。精度要求:当通项的绝对值小于等于10
-6时为止。
![](https://yi2.oss-cn-shenzhen.aliyuncs.com/e27f25a49b5047fc8cba4d02f5822d7f.png)
#include
#include<( (10) )>
double mycos( )
{ int n=1;
double s=0, t=1.0;
while (( (11) )>=1e-6)
{s+=t;
t*= ( (12) );
n=n+2;
}
return s;
}
int main()
{ double x;
scanf( );
printf( ;
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-4550-c003-bc7499099f00.html
点击查看答案
9.若有函数定义int fun() {int a=4, b=3, c=2; return a, b, c;},则调用函数fun后的返回值是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-ddf0-c003-bc7499099f00.html
点击查看答案
19.本程序的功能是:n个人围坐成一圈,从编号为1的人开始报数,凡报到数3的人出列,输出依次出列人的编号。
#include
#define N 10
int main()
{int i,j,m,k,a[N]={1,2,3,4,5,6,7,8,9,10},b[N];
i=j=m=k=0;
while( )
{if(a[i]!=0)( (47) );
if(k==3)
{( (48) ); a[i]=0; k=0; m++; }
i++;
if( )( (49) );
}
for(i=0;i<N;i++)
printf("%4d",b[i]);
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-2658-c003-bc7499099f00.html
点击查看答案
36.下面函数定义的头部正确的是( )。
A. int fun(int a[], b)
B. int fun(int a[], int a)
C. int fun(int a, int b)
D. int fun(char a[ ][], int b)
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-2ff8-c003-bc7499099f01.html
点击查看答案
8. 下面定义符号常量p为3.14中正确的是()。
A. #define p 3.14;
B. #define p(3.14)
C. #define p=3.14
D. #define p 3.14
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-4840-c003-bc7499099f00.html
点击查看答案
4.已知有声明“float a=1;double b=1;long c;”和语句“printf( ”,为了正确地以十进制形式输出printf参数表中第二个参数( )的值,则下划线位置处应填写的格式控制符是________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-f038-c003-bc7499099f00.html
点击查看答案