Filters
Question type

Study Flashcards

In C++, the condition 4 > y > 1 ) :


A) Evaluates correctly and could be replaced by 4 > y && y > 1 ) .
B) Does not evaluate correctly and should be replaced by 4 > y && y > 1 ) .
C) Evaluates correctly and could not be replaced by 4 > y && y > 1 ) .
D) Does not evaluate correctly and should not be replaced by 4 > y && y > 1 ) .

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

Correct Answer

verifed

verified

Which of the following does counter-controlled repetition require?


A) An initial value.
B) A condition that tests for the final value.
C) An increment or decrement by which the control variable is modified each time through the loop.
D) All of the above.

E) None of the above
F) All of the above

Correct Answer

verifed

verified

Consider the following code, assuming that x is an int with an initial value of 12 If x = 6 ) Cout << x; What is the output?


A) 6
B) 12
C) Nothing.
D) A syntax error is produced.

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

Correct Answer

verifed

verified

Which of the following is a parameterized stream manipulator used to format output?


A) setw
B) right
C) left
D) fixed

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

Correct Answer

verifed

verified

Which of the following data types can be used to represent integers?


A) char
B) long
C) short
D) All of the above.

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

Correct Answer

verifed

verified

A switch statement should be used:


A) As a single-selection structure.
B) As a double-selection structure.
C) As a multiple-selection structure.
D) To replace all if…else statements.

E) All of the above
F) A) and D)

Correct Answer

verifed

verified

An example of a unary operator is:


A) The < relational operator.
B) The = assignment operator.
C) The % arithmetic operator.
D) The ! logical operator.

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

Correct Answer

verifed

verified

Which of the following for headers is not valid?


A) for int i = 0; i < 10; i++ )
B) int i = 0; for ; i < 10; i++ )
C) for int i = 0; int j = 5; ; i++ )
D) All of the above.

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

Correct Answer

verifed

verified

Showing 21 - 28 of 28

Related Exams

Show Answer