226k views
0 votes
If the intquantity and decprice variables contain the numbers 3 and 15.75, respectively, the condition if intquantity > 0 andalso intquantity < 10 orelse decprice > 20 will evaluate to

User Stabledog
by
8.9k points

1 Answer

1 vote
if intquantity > 0 andalso intquantity < 10 orelse decprice > 20
expression evaluates to
(3>0 and 15.75<10 or 15.75>20)
which, using priority of operations, "and" has a higher precedence than "or",
=>
( (3>0 and 15.75<10) or 15.75>20)
=>
( false or false )
=>
false
User Rilent
by
8.4k points