Filters
Question type

Study Flashcards

The numeric data types in C++ can be broken into two general categories:


A) numbers and characters
B) singles and doubles
C) integer and floating point
D) real and unreal
E) None of the above

F) C) and D)
G) B) and D)

Correct Answer

verifed

verified

These are used to declare variables that can hold real numbers.


A) Integer data types
B) Real data types
C) Floating point data types
D) Long data types
E) None of the above

F) B) and D)
G) All of the above

Correct Answer

verifed

verified

Escape sequences are always stored internally as a single character.

A) True
B) False

Correct Answer

verifed

verified

________ must be included in any program that uses the cout object.


A) Opening and closing braces
B) The header file iostream
C) Comments
D) Escape sequences
E) None of the above

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

This control sequence is used to skip over to the next horizontal tab stop.


A) \n
B) \h
C) \t
D) \a
E) \'

F) B) and E)
G) A) and D)

Correct Answer

verifed

verified

Assuming you are using a system with 1-byte characters, how many bytes of memory will the following string literal occupy? "William"


A) 7
B) 14
C) 8
D) 1

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

Assume that a program has the following string object definition: string name; Which of the following statements correctly assigns a string literal to the string object?


A) name = Jane;
B) name = "Jane";
C) name = 'Jane';
D) name = (Jane) ;

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

The float data type is considered ________ precision, and the double data type is considered ________ precision.


A) single, double
B) float, double
C) integer, double
D) short, long
E) None of the above

F) C) and D)
G) None of the above

Correct Answer

verifed

verified

What is the value of cookies after the execution of the following statements? Int number = 38, children = 4, cookies; Cookies = number % children;


A) 2
B) 0
C) 9
D) .5
E) None of these

F) B) and E)
G) A) and E)

Correct Answer

verifed

verified

Which of the following defines a double-precision floating point variable named payCheck?


A) float payCheck;
B) double payCheck;
C) payCheck double;
D) Double payCheck;

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

When writing long integer literals or long long integer literals in C++ 11, you can use either an uppercase or lowercase L.

A) True
B) False

Correct Answer

verifed

verified

What will the following code display? What will the following code display?   A)    B)    C)    D)


A) What will the following code display?   A)    B)    C)    D)
B) What will the following code display?   A)    B)    C)    D)
C) What will the following code display?   A)    B)    C)    D)
D) What will the following code display?   A)    B)    C)    D)

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

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


A) Literals
B) Variables
C) Comments
D) Integers
E) None of the above

F) A) and C)
G) D) and E)

Correct Answer

verifed

verified

What is the output of the following statement? Cout << 4 * (15 / (1 + 3) ) << endl;


A) 15
B) 12
C) 63
D) 72
E) None of these

F) A) and C)
G) B) and D)

Correct Answer

verifed

verified

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


A) len
B) bytes
C) f(x)
D) int
E) sizeof

F) A) and B)
G) D) and E)

Correct Answer

verifed

verified

A variable's ________ is the part of the program that has access to the variable.


A) data type
B) value
C) scope
D) reach
E) None of the above

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

Which character signifies the beginning of an escape sequence?


A) //
B) /
C) \
D) #
E) {

F) A) and E)
G) C) and E)

Correct Answer

verifed

verified

If you do not follow a consistent programming style, your programs will generate compiler errors.

A) True
B) False

Correct Answer

verifed

verified

Which data type typically requires only one byte of storage?


A) short
B) int
C) float
D) char
E) double

F) D) and E)
G) A) and D)

Correct Answer

verifed

verified

A preprocessor directive does not require a semicolon at the end.

A) True
B) False

Correct Answer

verifed

verified

Showing 41 - 60 of 60

Related Exams

Show Answer