Question: A programmer intended to compute ( a AND b ) OR c , and wrote the following C + + code, which sometimes yields incorrect
A programmer intended to compute a AND b OR c and wrote the following C code, which sometimes yields incorrect output. Why?
c a & b
The ORing with c should appear after the parentheses, not before
The parentheses are interfering, and should not be present
If code only sometimes yields incorrect output, the compiler is likely broken
The bitwise operators should be replaced by logical operators
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
