如题目或答案有误,请通过BUG反馈告知我们修正,谢谢!

1、循环语句while(!E)中的表达式!E等价于:

E!=0

E!=1

E==0

E==1

2、若i、j已定义为int型,则以下程序段中内循环体的总的执行次数是
for(i=5;i>0;i--)
for(j=0;j<4;j++){…}

20

24

25

30

3、执行下列语句中,sum变量的值是:
int sum=0
for(int i=0;i<10;i++,sum+=i);

45

55

0

编译错误

4、以下程序执行后sum的值是
main()
{ int i,sum;
for(i=1;i<6;i++) sum+=i;
printf("%d\n",sum);
}

15

14

不确定

0

5、若有如下类定义:
class Sample
{  public:
Sample() {value=0;}
Set(int k) {value=k;}
   private:
int value;
};
Sample *p, obj;
p=&obj;
则对下列语句序列正确的描述是:

语句p=&obj;是把对象obj赋值给指针变量p

语句Sample *p, obj;会调用两次类Sample的构造函数

对语句*p.Set(5)的调用是正确的

语句p->Set(5)与语句obj.Set(5)等价

6、下面哪一项是不正确的字符串赋值或赋初值的方式

char *str; str="string";

char str[7]={'s','t','r','i','n','g'};

char str1[10];str1="string";

char str1[]="string",str2[]="12345678";

7、设有以下定义或语句,则输出的结果是?
(用small模式编译,指针变量占2个字节)
struct date
{long *cat;
struct date *next;
double dog;
}too;
printf("%d",sizeof(too));

20

16

14

12

8、若变量c为char类型,能正确判断出c为小写字母的表达式是

'a'<=c<= 'z'

(c>= 'a')||(c<= 'z')

('a'<=c)and ('z'>=c)

(c>= 'a')&&(c<= 'z')

9、已知有共用体变量data1定义如下:
union data
{ int i;
char ch;
float f;
} data1;
则变量data1所占的内存存储空间可表示为:

sizeof(int)

sizeof(char)

sizeof(float)

sizeof(int)+sizeof(char)+sizeof(float)

10、以下程序的输出结果是
fut( int **s,int p[2][3])
{ **s=p[1][1];}
main( )
{  int a[2][3]={1,3,5,7,9,11},*P;
p=(int *)malloc(sizeof(int));
fut(&p,a);
print("% ",*p);
}

1

7

9

11