Search Header Logo

CPP Midterm

Authored by John Oli

Computers

University

Used 6+ times

CPP Midterm
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

111 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What will be the output of the following code?

A

B

C

None of the above

2.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What will be the output of the following code?

Compilation error

A

B

Runtime error

3.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

What is the value of x after the following code is executed?

0

1

2

3

4.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which of the following is not a valid C++ comparison operator?

==

=

>=

!=

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the correct way to comment out a single line in C++?

// This is a comment

/* This is a comment */

' This is a comment

# This is a comment

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Media Image

Given the following code, what is the value of result?


3

13

8

40

7.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which of the following statements is true about the --- if-else --- statement in C++?

An if-else statement can have multiple else blocks.

An if-else statement can only have one if block.

The else block is optional.

if-else statements can only be used for numerical comparisons.

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?