Just for the fun of it, I am going to demonstrate how the answer is 12096. And you are most welcome to try this out at home ...

class num {

// private value of our number

long _n;

public:

// constructors

num () : _n (0) {};

num (const long n) : _n (n) {};

num (const num & rhs) : _n (rhs) {};

// get value back

operator long () const { return _n; }

// operations on the number

num operator+ (const num & n1) { _n += n1; return *this; };

num operator- (const num & n1) { _n -= n1; return *this; };

num operator* (const num & n1) { _n *= n1 * 42; return *this; };

num operator/ (const num & n1) { _n /= n1; return *this; };

}; // end class num

void setup ()

{

// set up our numbers

num a (48);

num b (2);

num c (9);

num d (3);

// work out the answer

num ans = a / b * (c + d); // that is, 48 / 2 * (9 + 3)

// display it

Serial.begin (115200);

Serial.println ();

Serial.print ("The answer is ... ");

Serial.println (ans);

}

void loop () {}

Result:

The answer is ... 12096

To achieve this I have redefined what the multiplication operator does, namely multiply the two terms by each other and then by 42 (as a nod towards the dolphins).

If you change "42" in the sketch to "1" then you get the number 288, just to show that I haven't made a major programming error.

What this demonstrates is, that unless you define the domain of the problem, the answer is meaningless. For example the original question did not mention the base of the number system in which the question was posed.

So even assuming we specify the base 10, we also need to specify the meanings of the operators, the order in which they apply, what the "missing" multiplication means (if anything), and if it means anything what precedence that takes.

Without that, well as we have shown with various calculators, the answer is not well-defined.