APP下载
首页
>
财会金融
>
39号C语言选择选择选择
搜索
39号C语言选择选择选择
题目内容
(
单选题
)
1、下面程序的输出结果是( )。int main(void) {int s, k;for(s = 1, k = 2; k < 5; k++)s += k;printf("%d\n", s);return 0;}(2分)

A、 9

B、 15

C、 1

D、 10

答案:D

39号C语言选择选择选择
1、判断年份y是否为闰年的表达式为( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-5dc7-c0d6-3f0ad517a300.html
点击查看题目
1、若定义:char s[][]= {}, *p = (char *)s;那么下列表达式语法正确,并且其值与 s[][]相等的表达式(并非一定与其等价)是( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-7c79-c0d6-3f0ad517a300.html
点击查看题目
1、若有以下语句,则输出结构变量a的age成员的语句为( )。struct Person {char name[] ;int age ;char sex ;} a = {} ;(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-7abb-c0d6-3f0ad517a300.html
点击查看题目
1、对于int x, y;语句if(x < 0)y = -1;else if(!x)y = 0;elsey = 1;等价于( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-32ac-c0d6-3f0ad517a300.html
点击查看题目
1、循环语句while (!x && !y)中的循环条件表达式等价于( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-8e06-c0d6-3f0ad517a300.html
点击查看题目
1、执行以下代码段后,输出的字符串是( )。#include #include int main(void) {char s1[], *s2 = "ab\0cdef";strcpy(s1, s2);puts(s1);.......return 0;}(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-2b81-c0d6-3f0ad517a300.html
点击查看题目
1、以下不能正确进行字符串初始化的是( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-b7dd-c0d6-3f0ad517a300.html
点击查看题目
1、以下叙述正确的是( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-decc-c0d6-3f0ad517a300.html
点击查看题目
1、若有定义:float w; int a,b; 则合法的switch语句是( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-89c9-c0d6-3f0ad517a300.html
点击查看题目
1、在代码:while( )中,!e等价于( )。(2分)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-6561-c0d6-3f0ad517a300.html
点击查看题目
首页
>
财会金融
>
39号C语言选择选择选择
题目内容
(
单选题
)
手机预览
39号C语言选择选择选择

1、下面程序的输出结果是( )。int main(void) {int s, k;for(s = 1, k = 2; k < 5; k++)s += k;printf("%d\n", s);return 0;}(2分)

A、 9

B、 15

C、 1

D、 10

答案:D

39号C语言选择选择选择
相关题目
1、判断年份y是否为闰年的表达式为( )。(2分)

A. 函数

B. 过程

C. 主程序和子程序

D. 子程序

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-5dc7-c0d6-3f0ad517a300.html
点击查看答案
1、若定义:char s[][]= {}, *p = (char *)s;那么下列表达式语法正确,并且其值与 s[][]相等的表达式(并非一定与其等价)是( )。(2分)

A. *(s+3)

B. *++p+2

C. *s+2

D. p[1][1]

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-7c79-c0d6-3f0ad517a300.html
点击查看答案
1、若有以下语句,则输出结构变量a的age成员的语句为( )。struct Person {char name[] ;int age ;char sex ;} a = {} ;(2分)

A. printf("%d", age);

B. printf("%d", person.age);

C. printf("%d", a.age);

D. printf("%d", person.a.age);

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-7abb-c0d6-3f0ad517a300.html
点击查看答案
1、对于int x, y;语句if(x < 0)y = -1;else if(!x)y = 0;elsey = 1;等价于( )。(2分)

A. y = 0;if(x != 0)if(x > 0)y = 1;elsey = -1;

B. y = 0;if (x >= 0)if(x)y = 1;elsey = -1;

C. if(x >= 0)y = 0;if(x)y = 1;elsey = -1;

D. if(x != 0)if(x > 0)y = 1;elsey = -1;

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-32ac-c0d6-3f0ad517a300.html
点击查看答案
1、循环语句while (!x && !y)中的循环条件表达式等价于( )。(2分)

A. x=0 && y=0

B. !(x|| y)

C. !(x == 0 || y == 0)

D. !(x == 0 && y == 0)

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-8e06-c0d6-3f0ad517a300.html
点击查看答案
1、执行以下代码段后,输出的字符串是( )。#include #include int main(void) {char s1[], *s2 = "ab\0cdef";strcpy(s1, s2);puts(s1);.......return 0;}(2分)

A. ab\0cdef

B. 内容不确定

C. ab

D. cdef

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-2b81-c0d6-3f0ad517a300.html
点击查看答案
1、以下不能正确进行字符串初始化的是( )。(2分)

A. char str[8] = {'g', 'o', 'o', 'd', '!'};

B. char str[8] = "good!";

C. char *str = "good!";

D. char str[] = {'g', 'o', 'o', 'd', '!'};

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-b7dd-c0d6-3f0ad517a300.html
点击查看答案
1、以下叙述正确的是( )。(2分)

A. do-while语句构成的循环只能用break语句退出

B. 用do-while语句构成的循环,在while 后的表达式为非零时结束循环

C. 用do-while语句构成的循环,在while后的表达式为零时结束循环

D. do-while语句构成的循环不能用其他语句构成的循环来代替

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-decc-c0d6-3f0ad517a300.html
点击查看答案
1、若有定义:float w; int a,b; 则合法的switch语句是( )。(2分)

A. switch(a);{case 1:printf("*\n");case 2:printf("**\n");}

B. switch(a+b);{case 1:printf("*\n");case 2:printf("**\n");default:printf("\n");}

C. switch(b){case 1:printf("*\n");default:printf("\n");case 1+2:printf("**\n");}

D. switch(w){case 1.0:printf("*\n");case 2.0:printf("**\n");}

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-89c9-c0d6-3f0ad517a300.html
点击查看答案
1、在代码:while( )中,!e等价于( )。(2分)

A. e == 0

B. e != 0

C. e == 1

D.

E. != 1

https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-6561-c0d6-3f0ad517a300.html
点击查看答案
试题通小程序
试题通app下载