in reply to Re: Find the biggest number from three numbers
in thread Find the biggest number from three numbers
#!/usr/bin/perl print "Enter a number\n"; chomp($a=<stdin>); print "Enter second number\n"; chomp($b=<stdin>); print "Enter third number\n"; chomp($c=<stdin>); $big=0; $equal=0; if($a == $b){ $big = $a; $equal = $a; } elsif($a > $b){ $big=$a; } else{ $big = $b; } if($equal == $c){ print "All numbers are same"; } elsif($big < $c){ $big = $c; print "The biggest number is $big \n"; }
|
|---|