Calculate SIMPLE INTEREST bash scripting UNIX shell scripting


Using read keyword it will get three input like principal value, rate of interest, and time period. UNIX Linux shell script command expression
Expr $p*$t*$r it will calculate the simple interest. CS1252 Operating Systems lap
Source code bash shell Programming Algorithm
echo " Enter the principle value: "
read p
echo " Enter the rate of interest:"
read r
echo " Enter the time period:"
read t
s=`expr $p \* $t \* $r / 100`
echo " The simple interest is "
echo $s

OUTPUT Calculate SIMPLE INTEREST CS1252 Operating Systems lap
[redhat35@localhost Rhel5]$ sh
Enter the principle value:
Enter the rate of interest:
Enter the time period:
The simple interest is

No comments:
Write comments