
C++ PRELIM EXAM

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
riszty moyo
Used 119+ times
FREE Resource
Student preview

50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Suppose x is 5 and y is 7. Choose the value of the following expression:
(x != 7) && (x <= y)
false
1
0
null
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Suppose that x is an int variable. Which of the following expressions always evaluates to true?
(x > 0) || ( x <= 0)
(x >= 0) || (x == 0)
(x > 0) && ( x <= 0)
(x > 0) && (x == 0)
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following expressions correctly determines that x is greater than 10 and less than 20?
10 < x < 20
(10 < x < 20)
10 < x && x < 20
10 < x || x < 20
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The expression in an if statement is sometimes called a(n) ____.
selection statement
action statement
decision maker
action maker
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following C++ code?
int x = 35;
int y = 45;
int z;
if (x > y)
z = x + y;
else
z = y – x;
cout << x << " " << y << " " << z << endl;
35 45 80
35 45 10
35 45 –10
35 45 0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When one control statement is located within another, it is said to be ____.
blocked
compound
nested
closed
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following will cause a logical error if you are attempting to compare x to 5?
if (x == 5)
if (x = 5)
if (x <= 5)
if (x >= 5)
Create a free account and access millions of resources
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade