We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d1b058 commit 0ed60e1Copy full SHA for 0ed60e1
simple-interest.sh
@@ -1,3 +1,4 @@
1
+# Here is new update in formula of SI by <riya-ri>
2
#!/bin/bash
3
# This script calculates simple interest given principal, annual rate of interest and time period in years.
4
# Do not use this in production. Sample purpose only.
@@ -12,15 +13,15 @@
12
13
# r, annual rate of interest
14
15
# Output:
-# simple interest = p*t*r
16
+# simple interest = (p*r*t)/100
17
-echo "Enter the principal:"
18
+echo "Enter the principal amount:"
19
read p
20
echo "Enter rate of interest per year:"
21
read r
22
echo "Enter time period in years:"
23
read t
24
-s=$(expr $p \* $t \* $r / 100)
25
+s=$(expr $p \* $r \* $t / 100)
26
echo "The simple interest is: "
27
echo $s
0 commit comments