Reversing a decimal number is a favourite programming problem in the technical interviews. Below is the problem statement and the solution implemented in Java. Problem statement Write an optimal program to reverse the digits in a decimal number without converting it to a string. Example: 123.45 -> 54.321 Solution [crayon-58fcdb4b91bee043151202/] Sample run [crayon-58fcdb4b91c2c316863084/]
The post Reversing a decimal number appeared first on Wilddiary.com.