1、若有变量声明:int x = 5, y = 7, z = 8; 执行表达式:z += x++|| y++ || ++z后,x、y、z的值分别是( )。(2分)
A. 6,7,9
B. 6,8,10
C. 6,8,8
D. 6,8,1
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-34c5-c0d6-3f0ad517a300.html
点击查看答案
1、如有定义语句int a,b; double x; 则下列选项中没有错误的是( )。提示:(int)x 表示将变量x的值强制转换成int类型。若x初始值为3.2则(int)x的结果是int类型,值为3。(2分)
A. switch(x%2) {case 0: a++; break;case 1: b++; break;default: a++; b++;}
B. switch((int)x%2 ) {case 0: a++; break;case 1: b++; break;default: a++; b++;}
C. switch(x%2) {case 0: a++; break;case 1.0: b++; break;default: a++; b++;}
D. switch((int)x%2.0) {case 0: a++; break;case 1: b++; break;default: a++; b++;}
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-38d9-c0d6-3f0ad517a300.html
点击查看答案
1、在C语言中,FILE类型由系统定义,保存在( )头文件中。(2分)
A. stdio.h
B. math.h
C. string.h
D. fstdio.h
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-4705-c0d6-3f0ad517a300.html
点击查看答案
1、在下列数学式中,变量x和y为double类型,而变量a和b为int类型,对应该数学式的正确表达式是( )。(2分)
A. 6/7*a*b/x/y
B. 6/x*a*b/7/y
C. 6*a*b/7/x/y
D. 6*a*b/7*x*y
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-3099-c0d6-3f0ad517a300.html
点击查看答案
1、设有以下说明语句struct STUDENT {int n;char ch[];} PER;(2分)
A. struct STUDENT是结构体类型
B. PER是结构体变量名
C. PER是结构体类型名
D. struct是结构体类型名
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-639f-c0d6-3f0ad517a300.html
点击查看答案
1、如下程序的功能是( )。#include int main(void) {char str[] = "array";int i = 0, j = 0;for(i = 0; str[] > '\0' ;i++)j++;printf("%d\n", j);return 0;}(2分)
A. 将数字字符串ch转换成十进制数
B. 将字符数组中的大写字母转换成小写
C. 将字符数组中的数字转换对应的字母
D. 求字符数组长度
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-f9df-c0d6-3f0ad517a300.html
点击查看答案
1、以下函数的返回值是( )。char *fun(char * p) {}(2分)
A. p自身的地址值
B. p[0]这个字符
C. p指向的地址值
D. 无意义的值
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-697d-c0d6-3f0ad517a300.html
点击查看答案
1、若有变量声明:int a = 3, b = 4, c = 5; 下列表达式中,值为0的是( )。(2分)
A. 'a' && 'b'
B. a <= b
C. a || b + c && b - c
D. !(a< b && c < b || b)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-2c0b-c0d6-3f0ad517a300.html
点击查看答案
1、对二维数组的正确定义是( )。(2分)
A. int a[2,3] = {1,2,3,4,5,6};
B. int a[][] = {1,2,3,4,5,6};
C. int a[2][] = {1,2,3,4,5,6};
D. int a[][3] = {1,2,3,4,5,6};
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-23b8-c0d6-3f0ad517a300.html
点击查看答案
1、若有如下程序:#define N 2#define M N + 1#define NUM 2 * M + 1int main( ) {int i;for( )printf( );return 0;}
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-b9a7-c0d6-3f0ad517a300.html
点击查看答案