Driver program to test above function
int main ( ) { char expr1 [ ] = "1 + 2*5 + 3" ; int res = evaluate ( expr1 ) ; ( res == -1 ) ? cout << expr1 << " ▁ is ▁ " << " Invalid STRNEWLINE " : cout << " Value ▁ of ▁ " << expr1 << " ▁ is ▁ " << res << endl ; char expr2 [ ] = "1 + 2*3" ; res = evaluate ( expr2 ) ; ( res == -1 ) ? cout << expr2 << " ▁ is ▁ " << " Invalid STRNEWLINE " : cout << " Value ▁ of ▁ " << expr2 << " ▁ is ▁ " << res << endl ; char expr3 [ ] = "4-2 + 6*3" ; res = evaluate ( expr3 ) ; ( res == -1 ) ? cout << expr3 << " ▁ is ▁ " << " Invalid STRNEWLINE " : cout << " Value ▁ of ▁ " << expr3 << " ▁ is ▁ " << res << endl ; char expr4 [ ] = "1 + + 2" ; res = evaluate ( expr4 ) ; ( res == -1 ) ? cout << expr4 << " ▁ is ▁ " << " Invalid STRNEWLINE " : cout << " Value ▁ of ▁ " << expr4 << " ▁ is ▁ " << res << endl ; return 0 ; }