400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 4)
50 câu hỏi
Which of the following is the correct usage of condition operators used in C?
a>b? c = 20 : c = 21;
a>b? c = 20;
max = a>b? a>c?a:c:b>c?b:c;
return (a>b)?(a:b);
Chọn C
The expression of the right hand side of || operators does not get evaluated if the left hand side determines the outcome.
True
False
Chọn A
Which of the following correctly shows the hierarchy of arithmetic operator in C?
/ + * –
* – / +
+ – / *
/ * + –
Chọn D
Which of the following is the correct order of evaluation for the below expression? z = x + y * z / 4 % 2 – 1;
* / % + – =
= * / % + –
/ * % – + =
* % / – + =
Chọn A
What will be the output of the program?
1 1 1 1
1 0 0 1
1 0 1 1
Other
Chọn C
What will be the output of the program?
1 0 1
1 1 1
0 0 0
0 1 0
Chọn C
What will be the output of the program?
z = 0
z = 1
z = 4
z = 3
Chọn B
Every operators has an Associativity
Yes
No
Chọn B
What will be the output of the program?
4 2 -1 1
4 3 0 1
3 2 -1 1
Chọn A
What is output of the program?
4 3 0 0
3 3 0 1
4 2 0 0
None of these
Chọn A
Are the following two statement same?
Yes
No
Chọn A
What will be the output of the program?
6
3
12
Complier error
Chọn A
What will be output of the program?
0 4 1
1 4 1
4 4 1
None of these
Chọn A
What will be output of the program?
4 4
3 4
2 2
2 3
Chọn A
What will be output of the program?
c = 1
c = 29
c = 10
c = 19
Chọn A
What will be output of the program?
4 3 2
4 3 3
2 3 2
2 3 3
Chọn D
What will be output of the program?
20
30
40
10
Chọn B
What is output of the program?
4
3
Complier error
None of above
Chọn A
What will be output of the program?
3, 0, 0,
3, 3, 3,
3, garbage, garbage
Another
Chọn A
What value is returned by function func()?
5
0
Exception
Another
Chọn C
What will be output when you will execute following c code?
mmmm aaaa nnnn
mmm aaa nnn
mmmm aaa nnn
Another
Chon A
What will be output when you will execute following c code?
AAAAAABCDEF
AAAAAABCDE
ABCDEF
Another
Chọn A
What gets printed?
3
4
5
6
Chọn D
What is output?
Hello
Nothing
Complier Error
Run time error
Chọn B
What is output?
012
Run time error
3
2
Chọn C
What is output?
Complie time error
Infinite Loop
Nothing
Chọn A
What is output?
In for loop
After loop
Complie error
Chọn B
What is output?
True
False
Complie Error
Another
Chọn B
What is output ?
5, 5
10, 10
Syntax error
Chọn B
What is output?
a = 5,b = 5
a = 4,b = 4
a = 5,b = 0
Another
Chọn C
What is output ?
Hello
Hello is printed 3 times
Hello is prined 4 times
Hello is printed 5 times
Chọn A
What is output ?
Hello
Hello is printed 3 times
Hello is prined 4 times
Hello is printed 5 times
Chọn A
What is output?
1 2 3
0 1 2 3
0 1 2
Chọn A
What is output ?
12345
123456
6
1234
Chọn C
What is output?
99 99 99
Complier Error
1
Chọn A
How many times will “vncoding” is printed on screen?
10
11
Infinite
Chọn A
What is output?
1 3
1 2
Không in ra kí tự nào
Chọn A
What is output?
Start End Start End
Start Start Start
Start Start Start Start
Chọn B
What is output of the following code?
1 2 3 4 5 6 7 8 9
3 4 5 6 7 8 9
4 5 6 7 8 9
4 5 6 7 8 9 10
Chọn D
What is output?
Infinite loop
35
38
39
Chọn C
What is output?
6, 5, 4, 3, 2, 1,
6, 5, 4, 3, 2, 1, 0,
Complier Error
Infinite loop
Chọn A
What is output?
0
-1
-2
-3
Chọn B
What is output?
0
2
3
-4
Chọn B
What is output?
print i and j from 0 till 4
print i and j from 0 till 5
print i from 0 to 4, print j from 0 to 5
Complier Error
Chọn B
What gets printed?
5
6
7
Another
Chọn B
What gets printed?
Value of x is 0
Value of x is not 0
Error
Chọn B
What gets printed?
14,18,
16,20,
16,21
Chọn C
What gets printed ?
-1
0
1
Complier error
Chọn A
What is output ?
Hello
Hi
Complier error
Chọn A
What is output?
x=0 y=1
x=0 y=0
Error syntax
Chọn B







