Math Problem
-
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
You might want to explain to him about BODMAS.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
-
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
Please Excuse My Dear Aunt Sally = PEMDAS = Parentheses, Exponents, (Multiply or Divide), (Add or Subtract) = PE(M|D)(A|S) Your friend is either thinking that parens are an operation or that all multiplies occur before divides. Placing a number next to parens creates an implicit multiplication. So, your equation becomes:
6 / 2 * (1 + 2)
And multiplications and divisions are of equal precedence, so they occur left to right in the order they appear. First, parens:
6 / 2 * 3
Next, all multiplications and divisions in order:
3 * 3
9It is not true that all multiplications occur before all divisions. The answer is 9.
-
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
It looks like you got a good reaction to this question and since there are already several answers, I will not go into that. I think the really important question is, what are you intending to do? If you are coding this (obviously using variables, function calls or other goodies), do you want the "9 result" or the "1 result"? When coding something like this, I prefer to put in additional parenthesis even when they are not needed due to the precedence of operators. I feel that separating the terms like that is the best way to avoid confusion when other developers have to work on the code.
(6/2)*(1+2)
(or6/(2*(1+2))
if that is your intention) might look like it is written by a noob, but everyone understands the meaning and can agree on the result. Adding spaces before and after the operators also helps the readability. Soren Madsen -
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
//No animal was harmed during execution of this program.
static void Main(string[] args)
{
int result = 6 / 2 * (1 + 2);
Console.WriteLine("Math Problem 6 / 2 * (1 + 2) = {0}", result); // Answer = 9
Console.ReadKey();}
Edit : The Answer can be 6 as well.. ( If you are doing yoga or you are a spiderman and looking at the screen upside down ) :)
Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
-
I was always under the belief that multiplication and division were on the same level in the order of operations, so you do them in the order they appear.
-
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
9, appearence is the boss when same weight operations.
[www.tamautomation.com] Robots, CNC and PLC machines for grinding and polishing.
-
hey guys... :-D :-D :-D We have a slight debate about this... 6/2(1+2) so whats the answer.. My answer is 9
6/2=3 1+2=3 3*3=9
My friends answer is 1 He did this(his saying he follow this PEMDAS)6/2(1+2) = 6/2*3 = 6/6
<<==== this is what he write/do answer1
erm, multiplying by the denominator might not be the method approved of in most text books. 6/2*3 = 18/2
I wanna be a eunuchs developer! Pass me a bread knife!
-
Well how did you do it???:confused::confused::confused:
-
Well how did you do it???:confused::confused::confused:
It's an insider joke taken from The Hitchhikers Guide To The Galaxy which states the ultimate answer to life, the universe, everything is 42. The problem is, no one knows what the question is.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier