1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solve mathematical Expression using stacks

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

  1. nabilbek

    nabilbek New Member

    Dec 16, 2009
    Likes Received:
    Trophy Points:
    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:

    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