What is the value of the following boolean


I selected "b" but I've always seem to get lost doing Boolean.

Assuming the following declarations:

int A=1, B=2, C=3, D=4;

What is the value of the following (Boolean) expression?

C == D || B > A && C

a. 0

b. 1

c. There is a syntax error in the expression.

d. There is no error, but the value cannot be determined from the information given.

My breakdown is as follows:

C == D || B > A && C
3 == 4 || 2 > 1 && 3
(3 == 4) || (2 > (1 && 3))
0 || (2 > (1))
0 || 1
answer is true or 1

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: What is the value of the following boolean
Reference No:- TGS01248420

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)