Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 30
1-
|
What function initalizes variables in a class:
|
|
A -
|
Constructor
|
|
B -
|
Destructor
|
|
C -
|
Constitutor
|
|
D -
|
A and B are correct.
|
2-
|
To include code from the library in the program, such as iostream, a directive would be called up using this command.
|
|
A -
|
#include <>; with iostream.h inside the brackets
|
|
B -
|
include (iostreamh)
|
|
C -
|
#include <> with iostream.h inside the brackets
|
|
D -
|
include #iostream,h;
|
3-
|
Single line comments explaining code would be preceded like in the following example
|
|
A -
|
/**
|
|
B -
|
//
|
|
C -
|
*//
|
|
D -
|
/*
|
4-
|
Which line has all reserved words ?
|
|
A -
|
char, int, float, doubled, short, long, unsigned, signed
|
|
B -
|
sizeof, const, typedef, static, voided, enum, struct, union
|
|
C -
|
if, else, for, while do, switch, continue, break
|
|
D -
|
defaulted, goto, return, extern, private, public, protected
|
5-
|
What punctuation must each command line have at the end of the line ?
|
|
A -
|
:
|
|
B -
|
,
|
|
C -
|
!
|
|
D -
|
;
|
6-
|
The C++ language is
|
|
A -
|
case-sensitive.
|
|
B -
|
Not case-sensitive.
|
|
C -
|
It depends
|
|
D -
|
None of these
|
7-
|
The number 5.9875e17 must be stored in a(n):
|
|
A -
|
int
|
|
B -
|
long
|
|
C -
|
double
|
|
D -
|
float
|
8-
|
Select the correct definition for a string variable.
|
|
A -
|
string mystr;
|
|
B -
|
string mystr[20];
|
|
C -
|
string[20] mystr;
|
|
D -
|
char mystr[20];
|
9-
|
The sentence "Hello world!" uses _____ elements in a character array.
|
|
A -
|
10
|
|
B -
|
11
|
|
C -
|
12
|
|
D -
|
13
|
10-
|
When you are creating a structure, you need to use the following keyword
|
|
A -
|
structure
|
|
B -
|
struct
|
|
C -
|
object
|
|
D -
|
record
|
[Người đăng: Thành Lãm - ST]
|