You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
591 B
Raku

#!/usr/local/bin/perl -w
print "Enter the first number : ";
my $num1 = <STDIN>; chomp $num1;
print "Enter the second number: ";
my $num2 = <STDIN>; chomp $num2;
print "Enter the third number : ";
my $num3 = <STDIN>; chomp $num3;
# A*B-C
my $answer = $num1 * $num2 - $num3;
print "$num1 * $num2 - $num3 = $answer \n";
# (A*B)-C
$answer = ($num1 * $num2) - $num3;
print "($num1 * $num2) - $num3 = $answer \n";
# A*(B-C)
$answer = $num1 * ($num2 - $num3);
print "$num1 * ($num2 - $num3) = $answer \n";