Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer all the question QUESTION 1 Which of the following is NOT correct

ID: 3729878 • Letter: P

Question

Please answer all the question

QUESTION 1 Which of the following is NOT correct of the “ operator? O It can have one operand 0 It uses short crcuit evaluation O It returns true if both operands are true O It has two operands QUESTION 2 In distinguishing an expression as true or false, C++ sees which of the following as true? O 1 O o O Any ror-zero value O true QUESTION 3 If the following code fragment is executed in an otherwise complete and correct program, which expression will be executed? x-0 if (x-12) yes statement else no statement 0 x-12 is illegal in the Boolean expression of an if statement The statement has incorrect syntax so will not compile at all click Save and Submit to save and submit. Click Save All Answers to save all answers Save

Explanation / Answer

1. It cannot have one operand because it needs two operands to perform the operation.

2. Any non zero value because anything that is not zero and can be converted to a boolean is not false, thus it must be true.

3. Yes statement will execute because of if the statement contains assignment expression which is always evaluated true.

4. The expression is true when left is true and right is false is incorrect.

5. 2nd option is the correct way.

6. 3rd option is incorrect.

7. && as per operator precedence

8. when the condition is ambiguous

9. a=6 because else block will be executed.

10. operator precedence

11. 1st option

12. 3rd option is not correct It can return true if any one of an operand is true.