Hello coders, today we are going to solve Reverse The Number CodeChef Solution.
Given an Integer N, write a program to reverse it.
The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer N.
For each test case, display the reverse of the given number N, in a new line.
- 1 <= T <= 1000
- 1 <= N <= 1000000
4 12345 31203 2123 2300
54321 30213 3212 32
Solution – Reverse The Number – CodeChef Solution
#Solution provided by CodingBroz for _ in range(int(input())): N = int(input()) Rev = 0 while N > 0: Rev = Rev * 10 + N % 10 N = N // 10 print(Rev)
Disclaimer: The above Problem (Reverse The Number) is generated by CodeChef but the Solution is provided by CodingBroz. This tutorial is only for Educational and Learning purpose.