question help! not looking for soloutions just wanna see if im right!

hey guys.
question is : Using parentheses, rewrite the following expression to indicate the correct order of evaluation. Then evaluate the expression, assuming a=5, b=2, and c=4.

my answer:

a % b * c && c % b * a
5 % 2 * 4 && 4 % 2 * 4
((5 % 2 * 4) && (4 % 2 * 4))
((1 * 4) && (0 * 4)) <----- I dont understand how 5 % 2 in the line before gives u 1 * 4)? doesn't % mean divide or is it 5 % 2 = remainder 1??
((4) && (0))
(4 && 0) <--- Anything not 0 is true
true && false
answer: false

please give me feedback as to how 5 % 2 * 4 in the line 3rd line of code gives 1 * 4 and what does the percentage sign mean?
thanks alot friends!




Yes, '%' is the modulo operator and results the remainder.
tyvm:)
Topic archived. No new replies allowed.