check logic 0 in reverse number program in java : <p>This is the logic to reverse a number. But this logic doesn't reverse the number having 0. for example i want to reverse 70 means it will give output as 7.
so kindly give logic to reverse number having 0. Thanks.</p>

<pre><code>while(num&gt;0)
        {
            rem=num%10;
            sum=(sum*10)+rem;
            num=num/10;
        }
        System.out.println("Output is:"+sum );
</code></pre>
