Filters
Question type

Study Flashcards

The result of a logical expression cannot be assigned to an int variable, but it can be assigned to a bool variable.

A) True
B) False

Correct Answer

verifed

verified

False

In a switch statement, if the value of the expression does not match any of the case values, the statements following the ____________________ label execute.

Correct Answer

verifed

verified

The term ____________________ describes a process in which the computer evaluates a logical expression from left to right and stops as soon as the value of the expression is known.

Correct Answer

verifed

verified

short-circ...

View Answer

Which of the following will cause a logical error if you are attempting to compare x to 5?


A) if (x == 5)
B) if (x = 5)
C) if (x <= 5)
D) if (x >= 5)

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

Correct Answer

verifed

verified

B

Which of the following operators has the lowest precedence?


A) !
B) ||
C) &&
D) =

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

Correct Answer

verifed

verified

If the expression in an assert statement evaluates to true, the program terminates.

A) True
B) False

Correct Answer

verifed

verified

Once an input stream enters a(n) ____________________ state, all subsequent input statements associated with that input stream are ignored, and the computer continues to execute the program, which produces erroneous results.

Correct Answer

verifed

verified

What does <= mean?


A) less than
B) greater than
C) less than or equal to
D) greater than or equal to

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

Correct Answer

verifed

verified

What is the output of the following C++ code? What is the output of the following C++ code?   A)  35 45 80 B)  35 45 10 C)  35 45 -10 D)  35 45 0


A) 35 45 80
B) 35 45 10
C) 35 45 -10
D) 35 45 0

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

Correct Answer

verifed

verified

Which of the following is the "not equal to" relational operator?


A) !
B) |
C) !=
D) &

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

Correct Answer

verifed

verified

In a ____ control structure, the computer executes particular statements depending on some condition(s) .


A) looping
B) repetition
C) selection
D) sequence

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

Correct Answer

verifed

verified

Which of the following is a relational operator?


A) =
B) ==
C) !
D) &&

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

Correct Answer

verifed

verified

In C++, && has a higher precedence than ||.

A) True
B) False

Correct Answer

verifed

verified

Consider the following statements. If score is equal to 75, the value of grade is "____________________". Consider the following statements. If score is equal to 75, the value of grade is  ____________________ .

Correct Answer

verifed

verified

When one control statement is located within another, it is said to be ____.


A) blocked
B) compound
C) nested
D) closed

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

Correct Answer

verifed

verified

What is the output of the following code? What is the output of the following code?   A)  section 2 B)  section 3 C)  section 4 D)  section 5


A) section 2
B) section 3
C) section 4
D) section 5

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

Correct Answer

verifed

verified

The value of the expression 6 < 5 || 'g' > 'a' && 7 < 4 is ____________________.

A) True
B) False

Correct Answer

verifed

verified

In C++, both ! and != are relational operators.

A) True
B) False

Correct Answer

verifed

verified

You can disable assert statements by using which of the following?


A) #include <cassert>
B) #define <assert>
C) #clear NDEBUG
D) #define NDEBUG

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

Correct Answer

verifed

verified

D

A compound statement functions as if it was a single statement.

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 40

Related Exams

Show Answer