Simple Calculator

First Number:

Second Number (or Exponent Number):

Preferred mathematical operation:
Multiply
Divide
Addition
Subtraction
Exponent

#### #!/usr/bin/perl -w use CGI ':standard'; $na = param('na'); $nb = param('nb'); $oper = param('oper'); if ($oper eq "mul") { $answ = $na * $nb; } elsif($oper eq "div") { $answ = $na / $nb; } elsif($oper eq "add") { $answ = $na + $nb; } elsif($oper eq "sub") { $answ = $na - $nb; $nd = "-"; } else {$answ = $na ** $nb; } print "Content-type:text/html\r\n\r\n"; print ""; print ""; print " Answer Page"; print ""; print ""; print "

The answer to your calculation is: $answ

"; print ""; print "";