Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Objective-C Basics Introduction to Operators and Conditionals Review Arithmetic Operators and Precendence

[Solved] z = (35+25)/2*(4/2)

15?

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

(35+25)/2*(4/2)

First the parentheses are evaluated giving 60/2*2 Everything else is left to right so 60 divided by 2 equals 30. 30 times 2 is equal to 60. This is because multiplication and division have the same priority or precedence. In such a case, we evaluate left to right.

(35+25)/2*(4/2): order of operations says do 35+25 to get 60, then divide by 2 to get 30, then multiply by 2 to get 60