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

JavaScript

Create a variable named "onehundred"

Create a variable named "onehundred" and assign the correct numeric value 100 to it using only variables a, b, and c and the common numeric operators.

var a = 1, b = 2, c = 4; my answer: var onehundred = c + c + b / b * c + c + a * c;

keep in mind I'm not good with math.

please help me

5 Answers

Your answer was only 20. Multiply your answer with 5, and you got 100. http://jsfiddle.net/H3p87/

I used this one

var onehundred = (a+b+c) * (a+b+c) + (a+b+c) + (a+b+c) + (a+b+c) + (a+b+c) + (a+b+c) + (a+b+c) + (a+b+c) + a + a; and it worked

Shorten answer : (a + c) * ( a + c) * ( b+ b);

thank you Arthur.

(a + c) * ( a + c) * c;