On Tue, 1 Mar 2016 12:05:14 +0530
Arghya Das <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/