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);
The expression of the right hand side of || operators does not get evaluated if the left hand side determines the outcome.
True
False
Which of the following correctly shows the hierarchy of arithmetic operator in C?
/ + * –
* – / +
+ – / *
/ * + –
Which of the following is the correct order of evaluation for the below expression? z = x + y * z / 4 % 2 – 1;
* / % + – =
= * / % + –
/ * % – + =
* % / – + =
What will be the output of the program?
1 1 1 1
1 0 0 1
1 0 1 1
Other
What will be the output of the program?
1 0 1
1 1 1
0 0 0
0 1 0
What will be the output of the program?
z = 0
z = 1
z = 4
z = 3
Every operators has an Associativity
Yes
No
What will be the output of the program?
4 2 -1 1
4 3 0 1
3 2 -1 1
What is output of the program?
4 3 0 0
3 3 0 1
4 2 0 0
None of these
Are the following two statement same?
Yes
No
What will be the output of the program?
6
3
12
Complier error
What will be output of the program?
0 4 1
1 4 1
4 4 1
None of these
What will be output of the program?
4 4
3 4
2 2
2 3
What will be output of the program?
c = 1
c = 29
c = 10
c = 19
What will be output of the program?
4 3 2
4 3 3
2 3 2
2 3 3
What will be output of the program?
20
30
40
10
What is output of the program?
4
3
Complier error
None of above
What will be output of the program?
3, 0, 0,
3, 3, 3,
3, garbage, garbage
Another
What value is returned by function func()?
5
0
Exception
Another
What will be output when you will execute following c code?
mmmm aaaa nnnn
mmm aaa nnn
mmmm aaa nnn
Another
What will be output when you will execute following c code?
AAAAAABCDEF
AAAAAABCDE
ABCDEF
Another
What gets printed?
3
4
5
6
What is output?
Hello
Nothing
Complier Error
Run time error
What is output?
012
Run time error
3
2
What is output?
Complie time error
Infinite Loop
Nothing
What is output?
In for loop
After loop
Complie error
What is output?
True
False
Complie Error
Another
What is output ?
5, 5
10, 10
Syntax error
What is output?
a = 5,b = 5
a = 4,b = 4
a = 5,b = 0
Another
What is output ?
Hello
Hello is printed 3 times
Hello is prined 4 times
Hello is printed 5 times
What is output ?
Hello
Hello is printed 3 times
Hello is prined 4 times
Hello is printed 5 times
What is output?
1 2 3
0 1 2 3
0 1 2
What is output ?
12345
123456
6
1234
What is output?
99 99 99
Complier Error
1
How many times will “vncoding” is printed on screen?
10
11
Infinite
What is output?
1 3
1 2
Không in ra kí tự nào
What is output?
Start End Start End
Start Start Start
Start Start Start Start
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
What is output?
Infinite loop
35
38
39
What is output?
6, 5, 4, 3, 2, 1,
6, 5, 4, 3, 2, 1, 0,
Complier Error
Infinite loop
What is output?
0
-1
-2
-3
What is output?
0
2
3
-4
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
What gets printed?
5
6
7
Another
What gets printed?
Value of x is 0
Value of x is not 0
Error
What gets printed?
14,18,
16,20,
16,21
What gets printed ?
-1
0
1
Complier error
What is output ?
Hello
Hi
Complier error
What is output?
x=0 y=1
x=0 y=0
Error syntax







