i need to solve this problem wihtout changing anything just put brackets to get the answer 10000
need the output using brackets only wihtout changing anything to be 10000
#include <iostream>
using namespace std;
int main()
{
int a = 10;
int b = 20;
cout << a + b * a + b + a * a * a << "\n"; // 10000
}
>Solution :
((10 + 20) * (10 + 20) + (10 * 10)) * 10 This will provide you with the answer. Look at operator precedence in C++ and THE BODMAS rule .