Exam 4: Selection

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The logical AND operator is ____.

Free
(Multiple Choice)
5.0/5
(42)
Correct Answer:
Verified

B

The evaluation feature for the && and || operators that makes the evaluation of an expression stop as soon as it is definitively determined that an expression is true or false is known as short-circuit evaluation.

Free
(True/False)
4.8/5
(38)
Correct Answer:
Verified

True

One of the main advantages of using a switch statement is that it avoids using the equality operator, ==.

Free
(True/False)
4.9/5
(34)
Correct Answer:
Verified

True

The switch statement usually results in more complex code than an equivalent if-else chain.

(True/False)
4.8/5
(36)

A relational expression consists of a boolean operator that compares two operands.

(True/False)
4.8/5
(28)

____ is not a relational operator.

(Multiple Choice)
4.9/5
(39)

The term "flow of control" refers to the order in which a program's statements are executed.

(True/False)
4.9/5
(31)

A ____ statement is a specialized selection statement that can be used in place of an if-else chain where exact equality to one or more integer constants is required.

(Multiple Choice)
4.9/5
(38)

A common practice for some programmers is to place the opening brace of a compound statement on the same line as the if and else statements.

(True/False)
4.9/5
(35)

The logical NOT operator is ____.

(Multiple Choice)
4.9/5
(38)

Including one or more if-else statements within an if or if-else statement is referred to as a ____ if statement.

(Multiple Choice)
4.7/5
(40)

Within a selection statement, an expression that evaluates to 0 or less is considered as false, while any positive is considered as true.

(True/False)
4.8/5
(28)

When an executing program encounters a(n) ____ statement, the condition is evaluated to determine its numerical value, which is then interpreted as either true or false.

(Multiple Choice)
4.8/5
(34)

The use of braces to enclose a set of individual statements creates a single block of statements, which may be used anywhere in a C program in place of a single statement.

(True/False)
4.8/5
(40)

It is a good practice to terminate the last case in a switch statement with a ____.

(Multiple Choice)
4.9/5
(29)

In C, relational expressions are evaluated to yield a boolean result.

(True/False)
4.8/5
(37)

When the ____ operator is used with two expressions, the resulting condition is true if either one or both of the two expressions are true.

(Multiple Choice)
4.8/5
(41)

The simplest C selection statement is the one-way if statement.

(True/False)
4.9/5
(36)

Indentation used within an if-else is critical to ensure that the code compiles correctly.

(True/False)
4.8/5
(33)

Any number of case labels may be contained within a switch statement, in any order.

(True/False)
4.8/5
(43)
Showing 1 - 20 of 44
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)