On Tue, 1 Mar 2016 12:05:14 +0530
Arghya Das <arghya0...@gmail.com> wrote:

> $num = 1234;
> $sum = 0;
> 
> while ( $num != 0)
> {
> $rem = $num % 10;
> $sum = ( $sum * 10 ) + $rem;
> $num = $num / 10;

    $num = int( $num / 10 );

> }
> 
> print $sum;
> 
> 
> 
> please tell what is wrong with the reverse number code .
> It prints Infinity.

See `perldoc -f int` for details.
http://perldoc.perl.org/functions/int.html


-- 
Don't stop where the ink does.
        Shawn

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to