Exam 4: Control Structures I Selection

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

Every else must be paired with a(n) ____________________.

(Short Answer)
4.8/5
(35)

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

(Short Answer)
4.8/5
(31)

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

(True/False)
4.8/5
(37)

What is the output of the following code? if (6 > 8) { \quad cout << " ** " << endl ; \quad cout << "****" << endl; } else if (9 == 4) \quad cout << "***" << endl; else \quad cout << "*" << endl;

(Multiple Choice)
4.9/5
(43)

What is the output of the following code fragment if the input value is 4? int num; Int alpha = 10; cin >> num; switch (num) { case 3: \quad alpha++; \quad break; case 4: case 6: \quad alpha = alpha + 3; case 8: \quad alpha = alpha + 4; \quad break; default: \quad alpha = alpha + 5; } cout << alpha << endl;

(Multiple Choice)
4.7/5
(41)

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
(37)

What does <= mean?

(Multiple Choice)
4.9/5
(39)

The symbol > is a(n) ____________________ operator.

(Short Answer)
4.8/5
(42)

Which of the following operators has the lowest precedence?

(Multiple Choice)
4.7/5
(30)

What is the output of the following C++ code? int x = 35; int y = 45; int z; if (x > y) \quad z = x + y; else \quad z = y - x; cout << x << " " << y << " " << z << endl;

(Multiple Choice)
4.7/5
(37)
Showing 41 - 50 of 50
close modal

Filters

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