Showing posts with label positive and negative numbers in perl. Show all posts
Showing posts with label positive and negative numbers in perl. Show all posts

Friday, August 5, 2016

Positive and Negative Numbers in Perl CGI

A simple program that I wrote in Perl CGI to display the list of positive and negative numbers in the web page of the web browser. The code is very easy to understand and use.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing

positive.cgi


#!"C:\xampp\perl\bin\perl.exe"


print "Content-type:text/html\n\n";
print "<font size='3'>";
printf "<font color='blue'>";
print "Positive and Negative Numbers in Perl";
print "<br><br>";

for (my $i=-10; $i <= 10; $i++) {
print "<font size='4'>";
printf "<font color='blue'>";
if ($i < 0) {
print "$i is a Negative Number";
print "<br />";
}
else {
  print "$i is a Positive Number";
print "<br />";
}
printf "</font> </font></font> </font>";

}