Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool execute_logic(int lhs, int rhs, string op)
- {
- bool result = NULL;
- if (op == "<")
- {
- result = (lhs < rhs);
- return result;
- }
- else if (op == ">")
- {
- result = (lhs < rhs);
- return result;
- }
- else if (op == "<=")
- {
- result = (lhs < rhs);
- return result;
- }
- else if (op == ">=")
- {
- result = (lhs < rhs);
- return result;
- }
- else if (op == "==")
- {
- result = (lhs < rhs);
- return result;
- }
- else if (op == "!=")
- {
- result = (lhs < rhs);
- return result;
- }
- else if (op == "||")
- {
- result = (lhs < rhs);
- return result;
- }
- else if(op == "&&")
- {
- result = (lhs < rhs);
- return result;
- }
- else
- {
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement