作者:深圳教育在线 来源:szedu.net 更新日期:2008-10-11
1.以下不是c语言规定保留字的是( )。 (1)float (2)integer (3)signed (4) unsigned 2.设int型变量x有初始值3,则表达式x++*5/10的值是( ) (1)0 (2)1 (3)2 (4)3 3.下述程序执行后的输出结果是( ) #include <stdio.h> main() { int x=’f’; printf("%c\n",’a’+(x-’a’+1)); } (1)G (2)H (3)I (4)J 4.设有程序,考试大整理! #include <stdio.h> main() { int i,j; for (i=0,j=1;i<=j+1;i+=2,j--) printf("%d\n",i); } 在运行上述程序时,for语句中循环体的执行次数是( ) (1)3 (2)2 (3)1 (4)0 5.在下述选项时,没有构成死循环的程序是( ) (1)int i=100 while (1) { i=i%100+1; if (i>100) break; } (2)for (;;); (3)int k=1000; do { ++k; }while (k>=10000); (4) int s=36; while (s);--s; 答案: 1.(2) 2.(2) 3.(1) 4.(3) 5.(3)
|