Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COSC 1436 Chapter 2 Quiz With Complete Solutions

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
12-03-2026
Written in
2025/2026

COSC 1436 Chapter 2 Quiz With Complete Solutions...

Institution
COSC 1436
Course
COSC 1436

Content preview

COSC 1436 Chapter 2 Quiz With
Complete Solutions

In a C++ program, two slash marks ( // ) indicate: - ANSWER The beginning of a
comment

A statement that starts with a # symbol is called a: - ANSWER Preprocessor
directive

For every opening brace in a C++ program, there must be a: - ANSWER Closing
brace

The ________ is/are used to display information on the computer's screen. -
ANSWER cout object

The ________ causes the contents of another file to be inserted into a program. -
ANSWER #include directive

________ represent storage locations in the computer's memory. - ANSWER
Variables

These are data items whose values do not change while the program is running.
- ANSWER Literals

You must have a ________ for every variable you intend to use in a program. -
ANSWER definition

Of the following, which is a valid C++ identifier? - ANSWER June1997
_employee_number
___department
myExtraLongVariableName
All of these are valid identifiers.

The numeric data types in C++ can be broken into two general categories: -
ANSWER integer and floating point

Besides decimal, two other number systems you might encounter in C++
programs are: - ANSWER Hexadecimal and Octal

A character literal is enclosed in ________ quotation marks, whereas a string
literal is enclosed in ________ quotation marks. - ANSWER single, double

, In memory, C++ automatically places a ________ at the end of string literals. -
ANSWER Null terminator

Which escape sequence causes the cursor to move to the beginning of the
current line? - ANSWER \r

What is the modulus operator? - ANSWER %

Which data type typically requires only one byte of storage? - ANSWER char

What is the output of the following statement?

cout << 4 * (15 / (1+3)) << endl;

Select one: - ANSWER 12

In programming terms, a group of characters inside a set of quotation marks is
called aNo: - ANSWER String literal

This is used to mark the end of a complete C++ programming statement. -
ANSWER Semicolon

Which character signifies the beginning of an escape sequence? - ANSWER \

________ must be included in any program that uses the cout object. - ANSWER
The header file iostream

If you use a C++ key word as an identifier, your program will: - ANSWER not
compile

What is the value of cookies after the execution of the following statements?

int number = 38, children = 4, cookies;

cookies = number % children; - ANSWER 2

This function in C++ allows you to identify how many bytes of storage on your
computer system an integer data value requires. - ANSWER sizeof

Character constants in C++ are always enclosed in ________. - ANSWER 'single
quotation marks'

These are used to declare variables that can hold real numbers. - ANSWER
Floating point data types

Written for

Institution
COSC 1436
Course
COSC 1436

Document information

Uploaded on
March 12, 2026
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$15.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Evergreenview Harvard University
Follow You need to be logged in order to follow users or courses
Sold
14
Member since
1 year
Number of followers
1
Documents
3062
Last sold
3 weeks ago

4.8

5 reviews

5
4
4
1
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions