c语言is_int(),C程序设计英文试题

C程序设计英文试题第1页

Section 1: Single Choice(2 mark for each item, total 20 marks)

1. The precedence of operator _____ is the lowest one.

A.? : B.== C.+= D.&

2. _____ is correct if it is used as a character constant.

A.?\? B.'\080' C.'%d' D.0xa

3. According to the declaration: char c1=92,c2=92; the value of expression _____ is 0. A.c1^c2 B.c1&c2 C.~c2 D.c1|c2

4. According to the declaration: int x=11; the value of expression (x++*1/3) is_____.

A.3 B.4 C.0 D.3.667

5. The value of expression sizeof("\num=%d\t") is ______.

A.7 B.8 C.9 D.10

6. In the following assignments or initialization, ______ is wrong.

A.char s[ ]="hello"; B.char s[10]; s="hello";

C.char *p="hello"; D.char *p; p="hello";

7. The following code fragment prints out ______.

#define MA(x, y) (x)*(y)

int i = 2;

i = 3/MA(i, i+2)+5;

printf(“%d\n”, i);

A.5 B.8 C.9 D.11

8. static struct {

int x, y[3];

} a[3] = {{1,2,3,4},{5,6,7,8},{9,10,11,12}}, *p;

p = a+1;

The value of expression *((int *)(p+1)+2) is ______.

A.3 B.7 C.10 D.11

9. After running the following code fragment, the value of s is ______.

int i=5, s=0;

《C Programming》TEST PAPER, Jan 22, 2005 2 / 8

do if (i%2) continue; else s+=i; while (--i);

A.15 B.9 C.6 D.5

10. According to the declaration: int (*p)[10], p is a(n) ______.

A.pointer B.array C.function D.element of array

Section 2: Fill in the blanks(2 mark for each item, total 30 marks)

1. The value of expression 1+4/5+15<7+4%5+(8,10) is ______.

2. The value of expression !!10 is _____.

3. The value of expression 3>2>1 is _____.

4. The value of expression ~(-1<<1) is ______.

5. The statement for (i=1; i<=9; i++) printf(“%3d”, ______);prints out the following numbers: 1 4 7 10 13 16 19 22 25.

6. According to the declaration: int a[10], *p=&a[1]+2; the last element of array a is p[__].

7. Write the declaration_____ with typedef, which makes PA a synonym for a character

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值