Search Header Logo

PL1 PRELIM EXAM

Authored by John Miranda

Computers

University

Used 7+ times

PL1 PRELIM EXAM
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "cout" object in C++?

Console output
File output
Conditional output
Character output

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the answer in this statement; age >=18 && age <=100 if the age is 12?

True

False

N/A

Undefined

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you comment a single-line in C++?

// comment
/* comment */
-- comment
## comment

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a constant in C++?

const
constant
define
final

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "new" operator in C++ do?

Allocates memory for variables
Deletes a variable
Initializes a variable
Performs mathematical operations

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the "endl" in C++?

Ends the program
Ends a loop
Ends a function
Inserts a newline character and flushes the stream

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to get the length of a string in C++?

strlen()
length()
size()
strlength()

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?