Question: Question 1 int n1 = 12; int n2 = 18; int n3 = 21; What is the result of each boolean expression? n1 < n2

Question 1

int n1 = 12;

int n2 = 18;

int n3 = 21;

What is the result of each boolean expression?

n1 < n2 ["True", "False"]

n3 == n2 ["True", "False"]

n3 == (n1 + 9) ["True", "False"]

(n2 > n1) && (n2 < n3) ["True", "False"]

n3 >= (n1 + n2) ["True", "False"]

! (n1 == n2) ["True", "False"]

Question 2

The following code will result in a divide by 0 error.

intValue = 0;

if (intValue != 0 && (10 / intValue) > 2)

// do something

True

False

Question 3

What is the output of the following code if intValue = 0?

if (intValue = 0)

cout << "true" << endl;

else

cout << "false" << endl;

true

false

Question 4

What is the output of the following code if score has a value of 85?

if (score < 60)

cout << "F" << endl;

else if (score < 70)

cout << "D" << endl;

else if (score < 80)

cout << "C" << endl;

else if (score < 90)

cout << "B" << endl;

else

cout << "A" << endl;

Group of answer choices

A

B

C

D

Question 5

What is the exact output of the following code if score has a value of 70?

if (score < 60)

cout << "F";

if (score < 70)

cout << "D";

if (score < 80)

cout << "C";

if (score < 90)

cout << "B";

if (score <= 100)

cout << "A";

Question 6

If A and B are boolean expressions, for (A && B) to evaluate to true, A and B must each separately evaluate to true.

True

False

Question 7

If A and B are boolean expressions, for (A || B) to evaluate to true, A and B must each separately evaluate to true.

Group of answer choices

True

False

Question 8

If A and B are boolean expressions, for ! (A && B) to evaluate to true, A and B must each separately evaluate to false.

True

False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!