1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Solve mathematical Expression using stacks

Discussion in 'C' started by nabilbek, Dec 16, 2009.

  1. nabilbek

    nabilbek New Member

    C++ program (using stacks) that reads from the user a mathematical expression like:
    (3+(4-9) * (3/4) * (3+2))

    1. The program should check if the expression is correct
    1.1 An expression is correct if:
    the parantheses are correctly added and are balanced
    examples of not correct expressions can be:
    )9+8(
    (((8-1)
    etc

    Assuming that the numbers are only one digit

    2. If the expression is correct, the program should evaluate the expression and display the result.
     

Share This Page