Question: in C++ write a program to ask user to Keep entering integer numbers through the keyboard. For end enter -1. Declare an empty stack and

in C++ write a program to ask user to Keep entering integer numbers through the keyboard. For end enter -1. Declare an empty stack and an empty queue. For every number that is even, enter it in the stack, otherwise enter it in the queue (odd numbers). Print both the stack and the queue. Then, pop one by one all the numbers from the stack and enter (enqueue) them in the queue. Again print both the stack and the queue.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!