31个编程问题(多选) [英] 31 programming questions (multiple choice)
问题描述
1。 C表达式10/3的值为________。
3.333333
3
1
3.000000
2.如果num2的初始值是10,那么在表达式num1 = num2 ++之后,num1和num2的值将分别为________; 。
10和10
11和10
10和11
11和11
3.如果num2的初始值是10,那么在表达式num1之后,num1和num2的值将分别为________ = ++ num2; 。
10和10
11和10
$ b $ 10 10和11
11和11
4.代码段后面的num值:num = 10; NUM + = 2;是_______。
8
14
10
20
12
5.代码段后面的num值:num = 10;数量 - = 2;是_______。
8
14
10
20
12
6.代码段后面的num值:num = 10; NUM * = 2;是_______。
8
14
10
20
12
7. C表达式5 * 123/5 + 123%5的值为__________。
89
178
113
194
126
8. C表达式14 * 8%5 - 23 /( - 4)的值是________。
-3
7
3
27
-7
9.逻辑表达式(0 | | 1)的结果是_________。
1
0
10 。逻辑表达式的结果!(1 | | 1)是________。
1
0
11 。以下哪一个逻辑运算符具有最高优先级?
不
AND
或
它们都具有相同的优先顺序
12.表达式13%4评估为__________。
0
2
1
3
13.在C中,while和for条件循环在________进行测试。
TOP
BOTTOM
14在_________测试条件循环的do。
TOP
BOTTOM
15 。以下哪种循环结构适用于预定义或已知的迭代次数?
while循环
for循环
循环播放
转到
16.只要测试表达式的值为_________,while循环结构将继续循环。
0
!0
17.只要测试表达式的值为____________,循环结构将继续循环。
0
!0
18.条件表达式中num的值:num = 1? 10:100;是________。
0
10
1
$
19.(n = 0; n< 11; n ++){/ * body * /}的循环体将执行_______次。
9
11
10
12
20.开关('A')
{
案例'A':printf(一个);
案例'B':printf(B);
}
将显示______。
A
AB
B
以上都不是
21.如果年龄的值是17,那么逻辑表达式的值:(年龄<20&& age> 12)是__________。
true
0
false
17
1
22.声明:
for(n = 0; n< 5; n ++ )
printf(A);
printf(B);
将显示_______。
ABABABABAB
AAAAAB
23 if语句中的条件表达式包含在___________中。
大括号
方括号
括号
以上都不是
24.如果if / else结构中的条件为真,则___________之后的指令集。
else语句被执行
条件被执行
if语句被执行
上述之一
25.以下哪一个循环至少执行一次循环体,而不管条件的值如何表达?
for
do - while
while
以上都不是
26.多行循环体包含在__________中。
棱括号括号
圆括号
方括号
花括号
27. do-while循环的条件表达式必须包含在__________中。
尖括号
圆括号
方括号
花括号
28.以下哪一项不是C中的循环结构?
而
for
do-while
if / else
29. for语句的第一部分指定___________。
初始化语句/ s(例如n = 0)
更新语句/ s(例如n ++)
测试条件(例如n <100)
以上都不是
30.第二部分for语句指定___________。
初始化声明/ s(例如n = 0)
测试条件(例如n <100)
更新声明/ s(例如n ++)
以上都不是
31.第三部分for语句指定___________。
初始化语句/ s(例如n = 0)
更新语句/ s(例如n ++)
test条件(例如n <100)
以上都不是
我的尝试:
任何人都可以检查这些答案是否正确吗?
这是一个练习中期,但我的教授没有给我们答案。
谢谢!
你是否有一些特别的理由想让其他人为你做功课?阅读:永远不会发生。
据我们所知,您只是突出显示随机答案,希望有人天真会纠正您,给您所有答案
1. The C expression 10 / 3 has a value of ________.
3.333333
3
1
3.000000
2. If the initial value of num2 is 10, then value of num1 and num2 respectively will be ________ after the expression num1 = num2++; .
10 and 10
11 and 10
10 and 11
11 and 11
3. If the initial value of num2 is 10, then value of num1 and num2 respectively will be ________ after the expression num1 = ++num2; .
10 and 10
11 and 10
10 and 11
11 and 11
4. The value of num after the code segment: num=10; num+=2; is _______.
8
14
10
20
12
5. The value of num after the code segment: num=10; num-=2; is _______.
8
14
10
20
12
6. The value of num after the code segment: num=10; num*=2; is _______.
8
14
10
20
12
7. The value of the C expression 5 * 123 / 5 + 123 % 5 is __________.
89
178
113
194
126
8. The value of the C expression 14 * 8 % 5 - 23 / (-4) is ________.
-3
7
3
27
-7
9. The result of the Logical expression (0 | | 1) is _________.
1
0
10. The result of the Logical expression !(1 | | 1) is ________.
1
0
11. Which ONE of the following logical operators has the highest order of precedence?
NOT
AND
OR
They all have the same order of precedence
12. The expression 13 % 4 evaluates to __________.
0
2
1
3
13. In C, the while and for conditional loop is TESTED at the ________.
TOP
BOTTOM
14. The do while conditional loop is tested at the _________.
TOP
BOTTOM
15. Which one of the following loop structures is appropriate for a predefined or known number of iterations?
while loop
for loop
do while loop
Go to
16. The while loop structure will continue looping as long as the test expression has a value of _________.
0
!0
17. do while Loop Structure will continue looping as long as the test expression has a value of ____________ .
0
!0
18. The value of num in the conditional expression: num = 1 ? 10 : 100; is ________.
0
10
1
100
19. The body of the loop for (n=0; n<11; n++) { /* body */ } will execute _______ times.
9
11
10
12
20. switch ('A')
{
case 'A': printf("A");
case 'B': printf("B");
}
will display ______.
A
AB
B
None of the above
21. If the value of age is 17 then the value of the logical expression:( age<20 && age>12 ) is __________ .
true
0
false
17
1
22. The statement:
for (n=0;n<5;n++)
printf("A");
printf("B");
will display _______.
ABABABABAB
AAAAAB
23. The conditional expression in an if statement is enclosed in ___________.
braces
square brackets
parentheses
none of the above
24. If the condition in an if/else structure is true, then the set of instructions after the ___________.
else statement is executed
condition is executed
if statement is executed
none of the above
25. Which ONE of the following loops executes the loop body at least once regardless of the value of the conditional expression?
for
do - while
while
none of the above
26. A multiple line loop body is enclosed in __________.
angular parentheses
parentheses
square brackets
curly braces
27. The do-while loop's conditional expression must be enclosed in __________.
angular brackets
parentheses
square brackets
curly braces
28. Which ONE of the following is not a loop structure in C?
while
for
do-while
if/else
29. The first section in a for statement specifies the ___________.
Initialization statement/s (e.g. n=0)
update statement/s (e.g. n++)
Test condition (e.g. n<100)
none of the above
30. The second section in a for statement specifies the ___________.
Initialization statement/s (e.g. n=0)
Test condition (e.g. n<100)
update statement/s (e.g. n++)
none of the above
31. The third section in a for statement specifies the ___________.
initialization statement/s (e.g. n=0)
update statement/s (e.g. n++)
test condition (e.g. n<100)
none of the above
What I have tried:
Can anyone check if those answers are correct?
This is a practice midterm, but my professor didnt give us the answers.
Thanks!
And is there some particular reason you're trying to get other people to do your homework for you? Read: Never going to happen.
For all we know, you just highlighted random answers in the hope that someone naive is going to correct you, giving you all the answers.
这篇关于31个编程问题(多选)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!