Even Odd Swap
CodeChefOpen on judge ↗
Chef and his sister are playing a game in which a number is given by his friend . Chef loves even numbers while his sister chooses odd ones. Zero is considered neither even nor odd by these siblings. Chef's sister chose all the best unit places and now he's going to lose , but not when his friend is alive. Help his friend to change the unit places. Given a number , swap even digits with odd ones.
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start