answersLogoWhite

0

Here's a simple Perl program to calculate simple interest:

use strict;
use warnings;

sub simple_interest {
    my ($principal, $rate, $time) = @_;
    return ($principal * $rate * $time) / 100;
}

my $principal = 1000;  # Example principal amount
my $rate = 5;          # Example interest rate
my $time = 2;          # Example time in years
my $interest = simple_interest($principal, $rate, $time);
print "Simple Interest: $interest\n";

This program defines a function to calculate simple interest and then prints the result for given principal, rate, and time values.

User Avatar

AnswerBot

1mo ago

What else can I help you with?