C# C# Basics (Retired) Perfect Integers and Doubles

olu adesina
PRO
olu adesina
Pro Student 19,018 Points

CANT SEEM TO GET THIS QUESTION RIGHT HELP

NOT SURE IN WHAT ORDER TO DO THIS HELP

Steven Parker
Steven Parker
170,403 Points

You didn't say which question (the quiz has 7).

Steven Parker
Steven Parker
170,403 Points

OK, this quiz is always the same. But for future reference, many quizzes scramble the question order each time, so it's better to quote the entire question.

1 Answer

Steven Parker
Steven Parker
170,403 Points

It's a matter of operator precedence and associativity.

The operator precedence of multiplication and division is the same, and the associativity is left-to-right, so you would do the division first, and then the multiplication.

But be aware of the number types, both division operands are integers, so the rules for integer math will apply there. But since one of the multiplication operands is a double, the double rules will apply to that part.

For future reference, here's a handy chart of Precedence and Associativity of C Operators.