11 lines
363 B
Perl
11 lines
363 B
Perl
print "Please enter a numerator: ";
|
|
chomp( $numerator = <STDIN> );
|
|
|
|
print "Please enter a denominator: ";
|
|
chomp( $denominator = <STDIN> );
|
|
|
|
# if condition is false, program prints message and terminates
|
|
$denominator != 0 or die "Cannot divide by zero";
|
|
|
|
# executes only if $denominator is not 0
|
|
print "\nThe result is ", $numerator / $denominator, "\n"; |