Even odd sepration

please tell me the correction!

Can you explain, where Exactly in your code are you taking inputs or reading data from the input.

Moreover, just implement a simple logic,
Check the input:
if it is even, add at tail
Else, add at head.

This will automatically keep all the odd numbers before even numbers in the list.

Try to resolve the problem.
Hope, this would help.
If you still have doubts, then feel free to ask.