Showing posts with label square a number in perl cgi. Show all posts
Showing posts with label square a number in perl cgi. Show all posts

Saturday, August 6, 2016

Square a Number in Perl CGI

A simple program that I wrote using Perl CGI to display a number and its square equivalent in the web page of the web browser.

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

square.cgi

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

print "Content-type:text/html\n\n";
print "<body style='font-family:verdana'>";
print "<font color='blue'>";
print "Square a Number in Perl";
print "<br><br>";
print "Written By Mr. Jake R. Pomperada, MAED-IT";
print "<br><br>";

print "<table border='1'>";
print "<tr><td>Number</td> <td> Square Equivaelnt</td>";
for ($i=1; $i <= 10; $i++) {
print "<tr><td>$i</td>";
print "<td>" ,$i ** 2,"</td> </tr>";

}
print "</table>";
print "</body> </font>";