Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Output
simple interest = p*t*r
```

_© 2022 XYZ, Inc._
_© 2023 XYZ, Inc._
7 changes: 4 additions & 3 deletions simple-interest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Here is new update on formula of Simple Interst under comment section by <riya-ri>
#!/bin/bash
# This script calculates simple interest given principal, annual rate of interest and time period in years.
# Do not use this in production. Sample purpose only.
Expand All @@ -12,15 +13,15 @@
# r, annual rate of interest

# Output:
# simple interest = p*t*r
# simple interest = (p*r*t)/100

echo "Enter the principal:"
echo "Enter the principal amount:"
read p
echo "Enter rate of interest per year:"
read r
echo "Enter time period in years:"
read t

s=$(expr $p \* $t \* $r / 100)
s=$(expr $p \* $r \* $t / 100)
echo "The simple interest is: "
echo $s
Loading