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.10E
Program Plan Intro

Program plan:

  1. line, ch, k variablesare used for input. There is structure stknode havingch, nextvalmember variables which represents the stack value.
  2. void push(stack **top, char alphabet) function inserts the node in the a stack.
  3. char pop(stack **top) function delete the value in the given and returns the delete value.

Program description:

The main purpose of the program is to create a stack from the input line as a character by character. Then it extracts the characters from the stack to print the reverse of the input line.

Blurred answer
Students have asked these similar questions
(Printing a Sentence in Reverse Order with a Stack) Write a program that inputs a line of text and uses a stack object to print the line reversed.
(Postfix Evaluation) Write a program that evaluates a valid postfix expression such as 6 2 + 5 * 8 4 / -The program should read a postfix expression consisting of digits and operators into a string. Using modified versions of the stack functions implemented earlier in this chapter, the program should scan the expression and evaluate it. The algorithm is as follows: While you have not reached the end of the string, read the expression from left to right. If the current character is a digit, Push its integer value onto the stack (the integer value of a digit character is its value in the computer’s character set minus the value of '0' in the computer’s character set). Otherwise, if the current character is an operator, Pop the two top elements of the stack into variables x and y. Calculate y operator x. Push the result of the calculation onto the stack. When you reach the end of the string, pop the top value of the stack. This is the result of the postfix expression. [Note: In Step 2…
(Sorting Words with a TreeSet) Write a program that uses aString method split to tokenize a line of text input by the user andplaces each token in a TreeSet. Print the elements of the TreeSet.[Note: This should cause the elements to be printed in ascending sortedorder.] (Java Programming)
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education