Операторы 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
10 questions
TLE QUIZ by G15

Quiz
•
10th Grade
12 questions
Python_4

Quiz
•
9th - 12th Grade
15 questions
Pemrograman Berorientasi Objek

Quiz
•
10th Grade
10 questions
Tema if

Quiz
•
1st - 10th Grade
10 questions
Вспоминаем условный оператор

Quiz
•
8th - 10th Grade
14 questions
C ++ For Loop

Quiz
•
9th - 12th Grade
15 questions
C++ INTRODUCCIÓN

Quiz
•
10th Grade
12 questions
Naredbe uvjeta u C++

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

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

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade