Skip to content

Commit 6c55781

Browse files
authored
Create simple-interest.sh
1 parent 42fea38 commit 6c55781

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

simple-interest.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# Simple Interest Calculator
3+
4+
echo "Enter Principal amount:"
5+
read principal
6+
echo "Enter Rate of interest:"
7+
read rate
8+
echo "Enter Time (in years):"
9+
read time
10+
11+
# Calculate Simple Interest
12+
si=$(echo "scale=2; ($principal * $rate * $time) / 100" | bc)
13+
14+
echo "Simple Interest is: $si"
15+
#!/bin/bash
16+
# Simple Interest Calculator
17+
18+
echo "Enter Principal amount:"
19+
read principal
20+
echo "Enter Rate of interest:"
21+
read rate
22+
echo "Enter Time (in years):"
23+
read time
24+
25+
# Calculate Simple Interest
26+
si=$(echo "scale=2; ($principal * $rate * $time) / 100" | bc)
27+
28+
echo "Simple Interest is: $si"

0 commit comments

Comments
 (0)