Skip to content

Commit 0ed60e1

Browse files
author
Riya-ri
authored
Update simple-interest.sh
1 parent 3d1b058 commit 0ed60e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

simple-interest.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Here is new update in formula of SI by <riya-ri>
12
#!/bin/bash
23
# This script calculates simple interest given principal, annual rate of interest and time period in years.
34
# Do not use this in production. Sample purpose only.
@@ -12,15 +13,15 @@
1213
# r, annual rate of interest
1314

1415
# Output:
15-
# simple interest = p*t*r
16+
# simple interest = (p*r*t)/100
1617

17-
echo "Enter the principal:"
18+
echo "Enter the principal amount:"
1819
read p
1920
echo "Enter rate of interest per year:"
2021
read r
2122
echo "Enter time period in years:"
2223
read t
2324

24-
s=$(expr $p \* $t \* $r / 100)
25+
s=$(expr $p \* $r \* $t / 100)
2526
echo "The simple interest is: "
2627
echo $s

0 commit comments

Comments
 (0)