+ 1

How would i write this into a JS problem using order of operations.

1. Add 10 and 22 | 2. Subtract 4 from 31 | 3. Multiply the results of the two previous operations | 4. Divide that number by 2

13th Apr 2017, 1:29 PM
Andrew Jackson
Andrew Jackson - avatar
3 Answers
+ 7
Do you mean (10+22)*(31-4)/2 ?? But how is it related to JS ?? May be: var a = 10+22; var b = 31-4; var c = a*b; var result = c/2;
13th Apr 2017, 1:56 PM
Ashwani Kumar
Ashwani Kumar - avatar
+ 2
Hint: ((10+22)*(31-4))/2
13th Apr 2017, 1:55 PM
Álvaro
+ 2
no just a simple print function using console.log and order of operations
13th Apr 2017, 4:57 PM
Andrew Jackson
Andrew Jackson - avatar