Write a
Input:
"A"
"B"
"C"
"D"
"E"
Output: "EDCBE"
Write a program in C++ to take input 5 strings and concatenate them in reverse order of their input, the string entered last should be present at the start in the concatenated string. Print the string formed in output.
Algorithm:
Use a loop that runs for 5 iterations to take input 5 strings. Push all the strings in a stack of strings and then after pushing 5 strings, initialize an empty string to store the concatenated string. Pop out all strings one by one from the stack and add them to the empty string until the stack does not become empty. Print the string formed in output.
Step by stepSolved in 4 steps with 2 images
- USing basic C++ code pls!!!arrow_forwardin C++ solve the following question in the picture :arrow_forwardIn C++ Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string. The output should include the input character and use the plural form, n's, if the number of times the characters appears is not exactly 1. Ex: If the input is: n Monday the output is: 1 n Ex: If the input is: z Today is Monday the output is: 0 z's Ex: If the input is: n It's a sunny day the output is: 2 n's Case matters. n is different than N. Ex: If the input is: n Nobody the output is: 0 n's The program must define and call the following function that takes the input string and character as parameters, and returns the number of times the input character appears in the input string.int CalcNumCharacters(string userString, char userChar)arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education