The data type of the variable in the switch and value of a case must not be of the same type.
C++ : Selection

Quiz
•
Computers
•
University
•
Medium
ENNA NAWI
Used 11+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
True
False
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
The _____ in switch statement is used to terminate the current sequence.
default
goto
break
jump
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
The default statement is optional and it can be used anywhere inside the switch statement.
True
False
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
We can have any number of case statements within a switch
True
False
5.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What set of characters do you use to create a compound statement (block of code) in C++?
[ ]
( )
{ }
< >
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which one is the correct syntax for C++?.
if [ gross > 100000 ] then
net = gross - tax;
if ( gross > 100000 )
net = gross - tax;
if { gross > 100000 } then
net = gross - tax;
if < gross > 100000 > then
net = gross - tax;
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is printed by the following program segment?
HelloWorld!
Hello
Hello
World!
World!
8.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Based on the following program segment, what is the output when input code is 'B'?
applebanana
bananacarrotinvalid
banana
invalid
9.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following conditions is to test whether weight is in between 50 to 90?
if (weight > 50 && weight < 90)
if (weight < 50 && weight > 90)
if (weight > 50 || weight < 90)
if (weight < 50 || weight > 90)
Similar Resources on Quizizz
14 questions
HTML-CSS

Quiz
•
9th Grade - University
12 questions
01 HTML/CSS Einführung

Quiz
•
University
10 questions
Java Control Flow statements

Quiz
•
University
10 questions
KNTT 12 BÀI 13

Quiz
•
12th Grade - University
12 questions
HTML Basics

Quiz
•
University
11 questions
Quiz 2

Quiz
•
University
10 questions
Kuis 1 User Interface JWD

Quiz
•
University
10 questions
bài ktra LT 2

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade