and u have a input number given 4,8,3 Still it print as zero Why??#!/usr/bin/perl use strict; open(FH,"$ARGV[0]") or die; my @temp=<FH>; close FH; my $quadratic = quadratic (\@temp); print "$quadratic\n"; sub quadratic { my ($a, $b, $c) = @_; return (-$b + sqrt($b*$b - 4*$a * $c)) / 2*$a; }
In reply to solving a quadratic equation by vis1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |