Professional Documents
Culture Documents
p
p
To print the prime series.
a.p àtart
8.p àtop
p
p
p
p
p
p
c c
p
p
p
p
p
print"Enter the limit: ";
$n=<stdin>;
print "The prime series is as printed below\n";
for($i=2; $i<=$n; $i++)
{
for($j=2; $j<=$i; $j++)
{
last if($i%$j==0);
}
if($i==$j)
{
print"$i\n";
}
}
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
c c
p
p
p
p
p
Enter the limit: 50
The prime series is as printed below
2
3
5
7
aa
a3
a7
a
23
2
3a
37
4a
43
47p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
p
Thus the PERL program to print the prime series was successfully executed and its output
was verified.