Variables in C++

Variables in C++

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

OOP 1 Undiksha

OOP 1 Undiksha

12th Grade - University

13 Qs

Tecnología Digital

Tecnología Digital

12th Grade

12 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

8525 AQA GCSE  3.1.1 Pseudo-code

8525 AQA GCSE 3.1.1 Pseudo-code

10th - 11th Grade

14 Qs

Examen final algoritmo

Examen final algoritmo

11th Grade

12 Qs

Programs and Variables in Code and Play

Programs and Variables in Code and Play

5th - 9th Grade

7 Qs

BÀI KIỂM TRA GIỮA KÌ 2 LỚP 5

BÀI KIỂM TRA GIỮA KÌ 2 LỚP 5

1st - 10th Grade

10 Qs

Archivos Digitales

Archivos Digitales

9th Grade - University

14 Qs

Variables in C++

Variables in C++

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

ELIZABETH DIERKER

Used 91+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?