Buckster_uk
12-10-2005, 06:32 PM
Write a for-loop that, for an unordered list of any randomly chosen 10 integers in the range 1 to 100, will remove all integers greater than 50 and, at the end, print in ascending numerical order the shortened list of integers in the range 1 to 50.
Code...
#!/usr/bin/perl
for ($count=1; $count<11; $count++)
{
$random = int( rand(100)) + 1;
$list = ($random < 51);
print "$list\n";
}
Code...
#!/usr/bin/perl
for ($count=1; $count<11; $count++)
{
$random = int( rand(100)) + 1;
$list = ($random < 51);
print "$list\n";
}