Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
Read a positive integer. Build a new integer whose digits are the reverse (e.g. 1205 → 5021). Print the reversed number.
Use % 10 and // 10 in a loop.
Skills: while, accumulation rev = rev * 10 + digit.