Filters
Question type

Study Flashcards

The expression 7 % 2 evaluates to


A) 1
B) 3
C) 3.5
D) 7.2
E) 14

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

Correct Answer

verifed

verified

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


A) 7
B) 8
C) 7.8
D) None of the above.
E) It's unpredictable. That's the problem.

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

Correct Answer

verifed

verified

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


A) June-2010
B) June.2010
C) June_2010
D) 2010June
E) Both C and D.

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

Correct Answer

verifed

verified

Every C++ program must have


A) comments.
B) variables.
C) literals.
D) a function called main..
E) all of the above.

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

Correct Answer

verifed

verified

The bool data type


A) can be used to store a single character.
B) has only two values: True and false.
C) is used to store extra-large numbers.
D) is used to represent numbers in E notation.
E) does none of the above.

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

Correct Answer

verifed

verified

B

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


A) float total;
B) double total;
C) auto total = 0.0;
D) All of the above
E) A and B, but not C

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

Correct Answer

verifed

verified

A ________ is used to mark the end of a complete C++ programming statement.


A) comment
B) period
C) semicolon
D) closing brace
E) new line

F) B) and E)
G) C) and E)

Correct Answer

verifed

verified

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


A) cout << endl;
B) cout << "endl";
C) cout << "/n";
D) All of the above
E) A and C, but not B

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

Correct Answer

verifed

verified

A

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


A) comment.
B) I/O statement.
C) preprocessor directive.
D) stream directive.
E) compiler option.

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

Correct Answer

verifed

verified

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


A) purpose
B) definition
C) comment
D) numeric value
E) output statement

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

Correct Answer

verifed

verified

The expression 5 % 2 evaluates to


A) 1
B) 2
C) 2.5
D) 5.2
E) 10

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

Correct Answer

verifed

verified

The expression 5 / 2 evaluates to


A) 1
B) 2
C) 2.5
D) 5.2
E) 10

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

Correct Answer

verifed

verified

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


A) < symbol
B) cin object
C) cout object
D) print object
E) output object

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

Correct Answer

verifed

verified

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


A) float average;
B) double average;
C) auto average = 0.0;
D) All of the above
E) A and B, but not C

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

Correct Answer

verifed

verified

C++ is a case-sensitive language.

A) True
B) False

Correct Answer

verifed

verified

True

A variable of the char data type can hold a set of characters like "January".

A) True
B) False

Correct Answer

verifed

verified

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


A) department_9
B) aVeryLongVariableName
C) last-name
D) All of the above.
E) Both A and B, but not C.

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

Correct Answer

verifed

verified

The following two statements both assign the value 5 to the variable dept. 5 = dept; dept = 5;

A) True
B) False

Correct Answer

verifed

verified

The following is a legal C++ statement to define and initialize a variable. char firstName = "Jack";

A) True
B) False

Correct Answer

verifed

verified

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


A) 7
B) 8
C) 7.8
D) None of the above.
E) It's unpredictable. That's the problem.

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

Correct Answer

verifed

verified

Showing 1 - 20 of 40

Related Exams

Show Answer