CPP Midterm

CPP Midterm

University

35 Qs

quiz-placeholder

Similar activities

Java Control Structures

Java Control Structures

11th Grade - Professional Development

39 Qs

Round_1 (B)| Coding Combat 2.0

Round_1 (B)| Coding Combat 2.0

University

30 Qs

C-Language Q1

C-Language Q1

University

30 Qs

Pemrograman Python Quiz ( Session I - III)

Pemrograman Python Quiz ( Session I - III)

University

33 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

C++ Quiz

C++ Quiz

University

40 Qs

Java Programming

Java Programming

University

30 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?

Discover more resources for Computers