Stacks and Queues

So I was wondering if I were to empty the elements of a stack into a queue, but i only wanted to empty the even numbers or the odd ones. What would the if statement
be to accomplish this. Im guessing for even it would be something like if(number % 2!=0)? What about for odd?
What you have is the if statement to detect odd. To detect even, you take the opposite of that
You may need another stack to temporarily store the even/odd numbers while emptying the odd/even ones. And then copy the data back.
Remember using push() and pop() operations.
Topic archived. No new replies allowed.