C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 12, Problem 12.14E
Program Plan Intro

Program Plan:

  • Read the expression including whitespaces using scanf.
  • Inside while loop the function evaluatePostFix perform following changes:
    • Within if statement, declare a char array value.
    • Next, use while loop to read each character from exp array and store it in value array.
    • Use function atoi to convert the value stored in value array in integer and push it inside stack.
    • Run else statement only if the expression is not blank space.

Program Description:

This program is the modified version of program provided in exercise 12.13 that can evaluate postfix expression for integers larger than 9.

Blurred answer
Students have asked these similar questions
Derive the run time of the following code
What is wrong in the following function?
find a counterexample for the statement,
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning