Exam 4: Control Structures I Selection

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

You can use either a(n) ____ or a ____ to store the value of a logical expression.

(Multiple Choice)
4.8/5
(37)

What is the value of x after the following statements execute? int x; X = (5 <= 3 && 'A' < 'F') ? 3 : 4

(Multiple Choice)
4.9/5
(30)

The expression (x >= 0 && x <= 100) evaluates to false if either x < 0 or x >= 100.

(True/False)
4.9/5
(37)

A control structure alters the normal sequential flow of execution in a program.

(True/False)
4.9/5
(38)

Putting ____________________ in front of a logical expression reverses the value of that logical expression.

(Short Answer)
4.9/5
(37)

Assume you have three int variables: x = 2, y = 6, and z.Choose the value of z in the following expression: z = (y / x > 0) ? x : y;.

(Multiple Choice)
4.9/5
(35)

The operators !, &&, and || are called relational operators.

(True/False)
4.7/5
(35)

In C++, the operators != and == have the same order of precedence.

(True/False)
4.8/5
(31)

Which of the following operators has the highest precedence?

(Multiple Choice)
4.9/5
(39)

Putting a semicolon after the parentheses following the expression in an if statement (that is, before the statement) is a(n) ____________________ error.

(Short Answer)
4.7/5
(36)

Which of the following expressions correctly determines that x is greater than 10 and less than 20?

(Multiple Choice)
4.9/5
(43)

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

(Multiple Choice)
4.8/5
(40)

Suppose P and Q are logical expressions.The logical expression P && Q is true if both P and Q are true.

(True/False)
4.9/5
(41)

For a program to use the assert function, it must include which of the following?

(Multiple Choice)
4.8/5
(36)

The ____________________ of relational and logical operators is said to be from left to right.

(Short Answer)
4.8/5
(50)

Suppose x is 5 and y is 7.Choose the value of the following expression: Suppose x is 5 and y is 7.Choose the value of the following expression:

(Multiple Choice)
4.8/5
(38)

Suppose found = true and num = 6.The value of the expression (!found) || (num > 6) is ____________________.

(Short Answer)
4.8/5
(33)

What is the output of the following C++ code? What is the output of the following C++ code?

(Multiple Choice)
4.8/5
(29)

Suppose that x is an int variable.Which of the following expressions always evaluates to true?

(Multiple Choice)
4.8/5
(41)

The value of the expression 7 + 8 <= 15 is ____________________.

(True/False)
4.7/5
(40)
Showing 21 - 40 of 40
close modal

Filters

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