Mark the following statements as true or false:
a. The result of a logical expression cannot be assigned to an int variable.
b. In a one-way selection, if a semicolon is placed after the expression in an if statement, the expression in the if statement is always true.
c. Every if statement must have a corresponding else.
d. The expression in the if statement:
if (score = 30)
grade = 'A';
always evaluates to true.
e. The expression:
(ch >= 'A' && ch <= 'Z')
evaluates to false if either ch < 'A' or ch >= 'Z'.
f. Suppose the input is 5. The output of the code:
cin >> num;
if (num > 5)
cout << num;
num = 0;
else
cout << "Num is zero" << endl;
is: Num is zero
g. The expression in a switch statement should evaluate to a value of the simple data type.
h. The expression !(x > 0) is true only if x is a negative number.
i. In C++, both ! and != are logical operators.
j. The order in which statements execute in a program is called the flow of control.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.