C++ Chapter 2

Ace your homework & exams now with Quizwiz!

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

#include

What value will be assigned to the variable number by the following statement? int number = 7.8;

7

Which of the following will cause the next output to begin on a new line?

cout << endl;

The ________ is used to display information on the computer's screen.

cout object

You must have a(n) ________ for every variable you include in a program.

definition

The bool data type

has only two values: true and false.

#include <iostream> is an example of a(n)

preprocessor directive.

A C++ character literal is enclosed in ________ quotation marks, whereas a string literal is enclosed in ________ quotation marks.

single, double

C++ automatically places ________ at the end of a string literal.

the null terminator

The expression 5 % 2 evaluates to

1

The expression 5 / 2 evaluates to

2

Which of the following definitions will allow the variable total to hold floating-point values?

All of the above; float total, double total, auto total = 0.0;

Which of the following is/are valid C++ identifiers?

June_2010

________ are data items whose values cannot change while the program is running.

Literals

In a C++ program, two slash marks ( // ) indicate the beginning of

a comment.

Every C++ program must have

a function called main.


Related study sets

Chapter 5: DNA Replication, Repair, and Recombination

View Set

Chapter 4 review: The American Revolution

View Set

GCSE ICT Revision - Hardware - RevisionWorld.com

View Set

Domain 4: Review; Manipulating Images

View Set

pn2 final 18,19,20,64,41-44,46-48 55, 56,57, 66, 11, 12,13, 27, 28,29, 30, 31, 35,36,33,34,39,40

View Set

Post-Classical Era Review and Study Guide

View Set

understanding Business - chapter 12

View Set