Chapter 3.78-79-Integer Literals

¡Supera tus tareas y exámenes ahora con Quizwiz!

base 10 (decimal)

If the first digit is in the range 1-9, the number is_______, thus 93 is base 10.

a-f and A-F

For hexadecimal values, the characters_______represent the hexadecimal digits corresponding to the values 10-15.

10 sixteens plus 5 ones

0xF is 15 and 0xA5 is 165 (_______).

integer literal, or constant

An_______, is one you write out explicitly, such as 212 or 1776.

decimal

By default, cout displays integers in_______form, regardless of how they are written in a program, as the following output shows:

base of a number constant

C++ uses the first digit, or two to identify the_______.

base 10 (the public favorite), base 8 (the old Unix favorite), and base 16 (the hardware hacker's favorite)

C++, like C, lets you write integers in three different number bases:_______.

base 8 (octal)

If the first digit is 0 and the second digit is in the range 1-7, the number is_______, thus 042 is octal and equal to 34 decimal.

base 16 (hexadecimal)

If the first two characters are 0x or 0X, the number is_______, thus 0×42 is hex and equal to 66 decimal.

convert the value

If you belong to a vintage PC club and read that the CGA video memory segment is B000 in hexadecimal, you don't have to_______to base 10 45,056 before using it in your program, instead, you can simply type in 0xB000.

hex or oct

If you omitted the using directive and instead used std::cout, std::end l, std::hex, and std::o c t, you could still use_______as the name for a variable.

hexadecimal or octal form

If you want to display a value in_______, you can use the special manipulator features of cout.

decimal

Listing 3.4 uses hex and oct to display the decimal value 42 in three formats. (_______is the default format, and each format stays in effect until you change it.)

name of a variable

Note that because the identifier hex is part of the std namespace and the program uses that namespace, this program can't use hex as the_______.

cout << hex ;

Note that code like the following doesn't display anything onscreen:_______, instead, it changes the way cout displays integers.

endl manipulator

Recall that the iostream header file provides the_______to give cout the message to start a new line.

dec, hex, and oct manipulators

The iostream header file provides the_______to give cout the messages to display integers in decimal, hexadecimal, and octal formats, respectively.

manipulator

The_______hex and oct is really a message to cout that tells it how to behave.

binary (base 2) value

Whether you write the value ten as 10, 012, or 0xA , it's stored the same way in the computer—as a_______.


Conjuntos de estudio relacionados

CompTIA Network + Final Practice Exam Cert Master

View Set

ECON201: Macroeconomics (practice 3)

View Set

Chapter 19_ Fundamental of Nursing

View Set

ECON-40: Ch.18-23: Microeconomics

View Set