Variables in C++

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
ELIZABETH DIERKER
Used 91+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What is the final value of x in the following code segment?
int x = 7;
x += 2*x;
63
21
81
This code segment will not compile.
2.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What is the final value of y in the following code segment?
int y = 3 * 7 % 8 + 1 * 4;
9
24
25
6
This code segment will not compile.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What is the final value of x in the following code segment?
double x = 7/2;
3 1/2
3.5
3.0
This code segment will not compile.
4.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What are the final values of y and z in the following code segment?
int z =4;
int y = 3 + z--;y = 7, z = 3
y = 7, z = 4
y = 6, z = 3
y = 6, z = 4
This code segment will not compile.
5.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What is the final value of y in the following code segment?
double y = 2;
int z = 3;
y /= z + 1;y = 1.0
y = 2.0
y = 0.5
y = 0.0
This code segment will not compile.
6.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What is the final value of w in the following code segment?
int w = int(3 / 2) + 5 % 10 - 3.5;
-2
3
-3
2
This code segment will not compile.
7.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
What is the final value of x in the following code segment?
(Assume the header file <cmath> has been included.)
double x = pow(2, 3) + 1 / 2;
9.5
8.5
8.0
9.0
This code segment will not compile.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
AP CSA - Inheritance, plus one while loop.

Quiz
•
12th Grade
10 questions
Control Statements - C

Quiz
•
12th Grade
11 questions
Python Quiz

Quiz
•
12th Grade
9 questions
JavaScript Strings

Quiz
•
9th Grade
15 questions
Introduction to Programming

Quiz
•
6th - 9th Grade
8 questions
Java Conditionals Unit 3

Quiz
•
9th - 12th Grade
10 questions
PC4.8-PC4.9 CSC403 T2

Quiz
•
9th Grade
9 questions
AP CS A Quiz 4 Practice

Quiz
•
9th - 12th 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
30 questions
Introduction to Computers

Quiz
•
8th - 9th 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