In this logic we take a number from user and reverse its digits like if user enters a number say 153 it produces its reverse that is 351. A simple while loop is used and a formula sum=sum*10 + r is applied to achieve the desired output. Logic is in the form of algorithm and can be implemented in any programming language. I am using % as a remainder operator which works in C, C++, Java, C# other languages may use mod for it.