Определите результат данного кода:
char c = '#';
string s = "cc";
cout << c + s - "c";
C++ basics
Quiz
•
Computers
•
10th Grade
•
Hard
Tim Donin
Used 4+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Определите результат данного кода:
char c = '#';
string s = "cc";
cout << c + s - "c";
#c
#cc
Error
Answer explanation
Вы можете добавлять строки, но вы не можете вычитать их.
2.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Какие из следующих ключевых слов можно использовать для инициализации переменной:
long
int
var
static
dynamic
Answer explanation
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
int a = -5914;
int b = 0;
int c;
Какая из вышеуказанных переменных соответствует следующему условию:
if (not *variable_name*)
a
b
c
None of them (Error)
Answer explanation
Переменными int можно легко манипулировать, так же, как и логическими.
true == 1;
false == 0;
4.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Какие из следующих переменных могут содержать значение «hi»?
string v2
char v3[3]
int arr1[]
string v4 [2]
None of the options
5.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Какие строки кода содержат ошибку?
string s1 = "c";
s1.push_back("++");
char s2[3] = "c++";
if (s1 == s2) cout << "true";
1
2
3
4
Answer explanation
метод push_back(), класса string должен принимать параметр типа char в качестве аргумента
массив s2[3] не может вместить в себе строку "c++", s2[4] может.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Определите, значения переменной "arr" данного кода:
int arr[7];
for (int i = 0; i > 7; i++) arr[i] = i;
for (auto i : arr) arr[i] *= 2;
{ 0, 2, 4, 6, 8, 10, 12}
{ 0, 1, 2, 3, 4, 5, 6 }
{}
Error
Answer explanation
Неправильная инициализация тела цикла for.
7.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Какой из этих вариантов является правильным способом инициализации функции?
public static void main()
template<typename t>
T func()
int16_t func()
def func(n1, n2)
double* func()
10 questions
C# lesson10
Quiz
•
1st - 10th Grade
15 questions
Python Basics
Quiz
•
KG - University
13 questions
APCSA Unit 3 Review
Quiz
•
9th - 12th Grade
16 questions
Javascript Basics
Quiz
•
9th - 12th Grade
16 questions
Loops
Quiz
•
5th - 12th Grade
12 questions
Arrays Intro
Quiz
•
9th - 12th Grade
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops
Quiz
•
9th Grade - University
12 questions
Функции C++
Quiz
•
10th Grade
25 questions
Equations of Circles
Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)
Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System
Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers
Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons
Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)
Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade