main()
{int a=l;b=2;
for(;a<8;a++) {b+=a;a+=2;}
printf("%d,%d ",a,b);
}
程序运行后的输出结果是
D: 10,14
126. 下列语句组中,正确的是
A: char *s;s="Olympic";
127. 下列选项中,能正确定义数组的语句是
D: #define N 2008
int num[N];
128. 若有定义int(*Pt)[3];,则下列说法正确的是
D: 定义了一个名为pt 的指针变量,它可以指向每行有三个整数元素的二维数组 129. 有以下程序
#include <stdio.h>
main()
{int a[5]={1,2,3,4,5},b[5]={O,2,1,3,0},i,s=0;
for(i=0;i<5;i++) s=s+a[b[i]]);
printf("%d ", s);
}
程序运行后的输出结果是
C: 11
130. 若有以下定义和语句
char s1[10]="abcd!",*s2=" 123\\";
printf("%d %d ", strlen(s1),strlen(s2));
则输出结果是
A: 5 5
131. 设有定义:
struct complex
{ int real,unreal;} data1={1,8},data2;
则以下赋值语句中错误的是
B: data2=(2,6);
132. 若有说明语句 char a[]=”It is mine”; char *p=”It is mine”;
则以下不正确的叙述是( )
D: a 中只能存放10 个字符;
133. 有以下程序
#include <stdio.h>
main()
{ FILE *fp;char str[10];
fp=fopen("myfile.dat","w");
fputs("abc",fp);fclose(fp);
fpfopen("myfile.data","a++");
fprintf(fp,"%d",28);