Exam
Chapter
1 Assessment (CPA)
Time
left: 17:53
Which of the following strings is a
proper integer number (in the "C++" language sense)?
Select correct answer (single choice)
3E14
314
3.14
3,14
314
3.14
3,14
What is the value of the following literal?
he 8.
010
Select correct answer (single choice)
10
the literal is invalid
2
8
the literal is invalid
2
8
What is the value of the following literal?
X10
Select correct answer (single choice)
10
16
the literal is invalid
2
16
the literal is invalid
2
What is the value of the following literal?
018
Select correct answer (single choice)
the
literal is invalid
2
16
10
2
16
10
What is the value of the following literal?
-1e-1
Select correct answer (single choice)
-10.0
-1.0
-0.1
the literal is invalid
-1.0
-0.1
the literal is invalid
What is the value of the x variable?
float x = 1. / 2. + 2. / 4.;
Select correct answer (single choice)
0.25
0.75
1.0
0.5
0.75
1.0
0.5
What is the value of the k variable?
int k = 1 % 2 + 4 % 2;
Select correct answer (single choice)
1
3
2
0
3
2
0
What is the final value of the k variable?
int i = 3, j, k;
if(i > 0) j = 2 + i * i;
if(i <= 0) j = 2 * i - 1;
if(j >= 0) k = j % i + 2;
if(j < 0) k = i % j + 2;
if(k < 0) k = k % i % j;
if(k >= 0) k = j % i % k;
Select correct answer (single choice)
-1
1
-2
2
1
-2
2
What is the final value of the k variable?
int i = 3, j = 2, k = -1;
if(i > 0) {
if(j <= 0) {
if(k < 0)
k++;
if(k <= 0)
k--;
}
if(j > 0)
i++;
}
if(i <= 0)
j++;
k = i + j + k;
Select correct answer (single choice)
3
6
4
5
6
4
5
What is the output of the following snippet if a digit 5 followed by Enter is entered through the keyboard?
int i = 3, j = ++i, k = ++i;
cin >> i;
cout << k + i << j - i << i * i;
Select correct answer (single choice)
10-545
10545
10-125
10125
10545
10-125
10125
give answers of the following test
Trả lờiXóa