Perl Script to give prime numbers upto the target number

prime numbers from target.pl
#!/usr/bin/perl
#ex4_3.plx
use strict;
use warnings;
print "upto what number you want to calculate primes?", "\n";
my $n = <STDIN>;
my $count=2;
my $j=2;
my $zero_remainder_found = 0;
my $remainder = $n % $j;
for (my $count=2; $count<=$n; $count++) {
    $zero_remainder_found = 0;
    for (my $j=2; $j<$count;$j++) {
        $remainder = $count % $j;
        if ($remainder == 0) {
            $zero_remainder_found = 1;
            last;
        }
    }
    if (!$zero_remainder_found) {
        print "$count is a prime number \n";
       
    }       
}


2 Comments

  1. you have written an excellent blog.. keep sharing your knowledge...
    Perl Training in Chennai
    Perl Course in Chennai

    ReplyDelete
  2. Perl Script To Give Prime Numbers Upto The Target Number ~ System Admin Share >>>>> Download Now

    >>>>> Download Full

    Perl Script To Give Prime Numbers Upto The Target Number ~ System Admin Share >>>>> Download LINK

    >>>>> Download Now

    Perl Script To Give Prime Numbers Upto The Target Number ~ System Admin Share >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete
Previous Post Next Post