Hi,
i am a beginner in Perl. All I want to do is a simple operation of saving the reminders of a continuous division of same number until the quotient becomes 1.
I hope the code is logically correct but nothing is showing in the output.
here is the code:
Thanks for the help.
i am a beginner in Perl. All I want to do is a simple operation of saving the reminders of a continuous division of same number until the quotient becomes 1.
I hope the code is logically correct but nothing is showing in the output.
here is the code:
Code:
#!usr/bin/perl
#scrap.pl
use warnings;
use strict;
my $test=27;
my @arr1;
for(my $i=0;$test<=1;$i++)
{
print "entered loop !!! \n";
print $test,"\n";
$arr1[$i]=$test%2;
$test/=2;
print $test,"\n";
}
print @arr1;
Comment