400 Câu hỏi trắc nghiệm lập trình C/C++ có đáp án (Phần 2)
50 câu hỏi
compare();
stringcompare();
cmp();
strcmp();
Chọn D
append();
stringadd();
strcat();
stradd();
Chọn C
stdio.h
conio.h
stdlib.h
ouput.h
Chọn A
scanf( )
printf( )
getch( )
Chọn B
>
>
<=
None above
Chọn D
The first statement of main( )
The first statement of program
The first statement after the comment /**/
The first statement of end function
Chọn A
Because they tell the complier that a function is declared later
Because they make program readable
Because they allow the programmer to see a quick list of function in the program along with the argument for each function.
All of the above
Chọn A
rem = 3.14%2.1;
rem = fmod(3.14, 2.1);
rem = modf(3.14, 2.1);
Remainder cannot be obtain in floating point division.
Chọn B
1
2
3
1 & 2 & 3
Chọn B
1
2
3
1 and 3
Chọn D
Declaration
Definition
A & B
Chọn A
Both are identical
No difference, except extern int fun( ); is probably in another file
int fun( ); is overrided with extern int fun( );
None of these
Chọn A
Extern int a is declaration, int a = 20 is the definition
Int a = 20 is declaration, extern int a is the definition
Int a = 20 is definition, a is not defined
a is declared, a is not defined
Chọn A
Internal and External
External, Internal and None
External and None
Internal
Chọn B
* (asterisk)
| (pipeline)
– (hyphen)
_ (underscore)
Chọn D
float
double
long double
far double
Chọn B
ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
Chọn A
Yes
No
Chọn A
True
False
Chọn B
True
False
Chọn A
True
False
Chọn A
True
False
Chọn A
Yes
No
Chọn B
True
False
Chọn B
ABCD
DCBA
0xABCD
Depend on big endian or little endian architecture.
Chọn D
float, double
short int, double, long int
float, double, long double
double, long int, float
Chọn C
1.000000 2.000000
1.500000 1.000000
2.000000 1.000000
1.300000 2.000000
Chọn C
math.h
stdlib.h
log.h
dos.h
Chọn A
use 3.14LD
use 3.14L
use 3.14DL
use 3.14LF
Chọn B
use float(3.14f)
use 3.14f
use f(3.14)
use (f)(3.14)
Chọn B
y = (int)(x + 0.5)
y = int(x + 0.5)
y = (int)x + 0.5
y = (int)((int)x + 0.5)
Chọn A
1.670000e+000, 1.670000, 1.67, 1.670000,
Complier Error
1.67e, 1.67000, 1.670, 1.67
1.67e, 1.67, 1.67000, 1.67f
Chọn A
LaptrinhC++
abc
Complier error
None of these
Chọn B
LaptrinhC++
abc
Complier error
None of these
Chọn A
True
False
Chọn A
100
Garbage value
Error
0
Chọn A
The element will be set to 0.
The complier would report an error.
The program may crash if some important data gets overwritten
The array size would appropriately grow
Chọn C
6.000000
6
Error
Chọn A
During editing
During linking
During execution
During preprocessing
Chọn D
8 4 8
4 4 8
4 8 10
4 8 12
Chọn A
True
False
Chọn A
1. KR Notation and 2. ANSI Notation
1. Pre ANSI C Notation and 2. KR Notation
1. ANSI Notation and 2. KR Notation
1. ANSI Notation and 2. Pre ANSI Notation
Chọn C
True
False
Chọn A
True
False
Chọn A
True
False
Chọn A
True
False
Chọn A
True
False
Chọn A
Infinite times
65535 times
Till stack overflows
Cannot call main( ) in main( )
Chọn C
True
False
Chọn B
Yes
No
Chọn A







