Hi
I have tried my level best to unsuccessfully figure where the error lies. Could you please help me with it? Given below is the code and two outputs which are obviously wrong.
Code:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
system("color 1a");
int exp;
cout << "enter the expression = ";
cin >> exp;
cout << "entered expression evaluates = " << exp << endl;
system("pause");
}
OUTPUT #1:
Code:
enter the expression = (5-9)
entered expression evaluates = 2
Press any key to continue . . .
OUTPUT #2:
Code:
enter the expression = ((9+18)-18)/9
entered expression evaluates = 2
Press any key to continue . . .