400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 3)
50 câu hỏi
Yes
No
Chọn B
Yes
No
Chọn A
Yes
No
Chọn B
Add prototype: float f(int, float);
Add prototype: float f(a, b);
Add prototype: float f(float a, int b)
Chọn A
Yes
No
Chọn B
It prints garbage values infinitely
Runs infinitely without printing anything
Error: main( ) cannot be called inside printf( )
No Error and print nothing
Chọn B
Yes
No
Chọn B
Yes
No
Chọn B
Yes
No
Chọn B
543210
54321
12345
Infinite loop
Chọn D
4
5
6
Another
Chọn A
Missing parenthesis in return statement
The function should be defined as int f(int a, int b)
Re-declaration of a
None of above
Chọn B
Error: Prototype declaration
No error
Error: return statement cannot be used with conditional operators
None of above
Chọn C
6 6
5 6
Complier error
None of above
Chọn A
4, 3, 4, 3
4, 4, 5, 5
3, 4, 3, 4
None of above
Chọn A
The function calculates the value of 1 raised to power n
The function calculates the factorial value of an integer
The function calculates the square root of an integer
None of above
Chọn B
Error: cannot convert ‘void’ to ‘int’
Error:
Chọn A
8 4 1
8 2 1
4 4 1
Depend on complier
Chọn A
1 4 5
1 4 7
8 4 7
Another
Chọn A
1
0
0.1
Chọn B
-6
5
4
Another
Chọn A
Avatar
Alien
Error at (*)
Another
Chọn A
7
8
9
Another
Chọn B
4
0
1
5
Chọn A
7
6
5
1
Chọn A
0
Error
1
x isn’t defined
Chọn C
0
1
Error Comlier
Chọn A
1 1
1 0
‘x’ undeclared identifier
Chọn C
1
0
Error
Chọn C
1
Error
0
Chọn C
0123456789
0000000000
0101010101
Chọn A
1
5
20
‘x’ isn’t defined
Chọn B
Garbage Garbage Garbage
5 10 15
15 10 5
Run time error
Chọn A
c:/tc/bin/rw.c
c: c inw.c
c:cinw.c
w.c in
Chọn D
5
6
0
Complier error
Chọn D
135
8
-121
121
Chọn C
12480
1248@
12500
12522
Chọn A
Hi
Hello
None of above
Chọn A
i = 0
i = 1
Error
None of these
Chọn B
int length;
char int;
int long;
float double;
Chọn A
N = 20
N = 10
Error
No Output
Chọn A
0 0 0
1 2 2
1 1 1
Error
Chọn A
3
4
Complier Error
3.14
Chọn B
int i = 35; i = i%5
short int j = 5; j = j;
long int k = 123L; k = k;
float a = 3.14; a = a%3;
Chọn D
Error: Declaration syntax error v (or) ‘v’: illegal use of type ‘void’
Program terminate abnormally
No error
None of these
Chọn A
The for loop would not get executed at all
The for loop would get executed only once
The for loop would get executed 5 times
The for loop would get executed infinite times
Chọn D
No error
display( ) is not declared
None of these
Chọn B
1. !
2. sizeof
3. ~
4. &&
1, 2
1, 3
2, 4
1, 2, 3
Chọn D
True
False
Chọn B
f1, f2, f3
f3, f2, f1
Order may vary from complier to complier
None of above
Chọn C







