Операторы If и Switch в C++

Quiz
•
Computers
•
10th Grade
•
Medium
Надежда Натарова
Used 19+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Укажите верный синтаксис для оператора if C++?
if (логическое выражение) {оператор1 }; else {оператор2};
if test
IF test
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Заполните пусте места, чтобы сравнить переменные и вывести на экран «hi there»:
int x = 5;
int y =3;
if ( ......... )
{
cout <<«hi there»;
}
х=y
x>y
x<y
x!=y
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Какой оператор используется для сравнения?
=
<<
==
!=
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Заполните пустые места, чтобы сравнивать переменные и вывести «not equal» на экран.
int x = 10;
int y = 8;
if ( ................) {
cout << «not equal»;
}
==
!=
=
<>
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Каков результат работы следующего франмента кода?
int x = 0;
switch(x)
{
case 1: cout << "Один";
case 0: cout << "Нуль";
case 2: cout << "Привет мир";
}
а) НульПривет мир
б) Привет мир
в) Один
г) Нуль
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Заполните пустые места, чтобы проверить значение переменной x; если x равен 2, вывести на экран ‘its 2"; иначе (случай default), вывести на экран "the default case";
int x;
cin>>x;
switch (x) {
case 2: cout<<"its 2″<<endl; break;
............... : cout<<«the default case»<<endl;
}
default
else
ifelse
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Что произойдёт, если мы забудем добавить «break» после «case»?
Будут выполнены остальные операторы case
Ничего
Ошибка времени выполнения
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
HTML

Quiz
•
8th - 12th Grade
10 questions
Instructiunea de decizie 9D

Quiz
•
9th - 10th Grade
13 questions
1.4 Wired and Wireless Networks

Quiz
•
10th - 11th Grade
10 questions
J277 - Networks Lesson 2

Quiz
•
8th - 11th Grade
10 questions
Bài tập trắc nghiệm C++

Quiz
•
3rd - 12th Grade
12 questions
Informatica 10 Operatori

Quiz
•
10th Grade
17 questions
"switch" Java Statement - 1

Quiz
•
9th - 10th Grade
10 questions
Evaluasi Struktur Kontrol Perulangan C++

Quiz
•
10th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade