CPP Midterm

CPP Midterm

University

35 Qs

quiz-placeholder

Similar activities

FINAL_EXAM (CFP_122)

FINAL_EXAM (CFP_122)

University

35 Qs

Round_1 (B)| Coding Combat 2.0

Round_1 (B)| Coding Combat 2.0

University

30 Qs

Python: Control Structures Review

Python: Control Structures Review

9th Grade - University

34 Qs

Python.Comp Quiz (Python Coding)

Python.Comp Quiz (Python Coding)

9th Grade - University

40 Qs

function in Python

function in Python

University

37 Qs

CS Basics

CS Basics

4th Grade - University

35 Qs

Decision and Case Control Statements in C

Decision and Case Control Statements in C

University

35 Qs

[AP CSP] Programming with Conditionals [If, Elif, Else]

[AP CSP] Programming with Conditionals [If, Elif, Else]

9th Grade - University

35 Qs

CPP Midterm

CPP Midterm

Assessment

Quiz

Computers

University

Hard

Created by

John Oli

Used 4+ times

FREE Resource

35 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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?