To Create a Simple Maths Calculator Using Linux Shell Scripts
echo "Enter The First Number:->";
read no1
echo "Enter The Second Number:->";
read no2
echo "1:Addition";
echo "2:Substraction";
echo "3:Multiplication";
echo "4:Division";
echo "Enter The Choice:->";
read c
if ((c==1))
then
echo $((echo $no1 + $no2) |bc)
elif ((c==2))
then
echo $((echo $no1 - $no2) |bc)
elif ((c==3))
then
echo $((echo $no1 \* $no2) |bc)
elif ((c==4))
then
echo $((echo $no1 / $no2) |bc)
fi
read no1
echo "Enter The Second Number:->";
read no2
echo "1:Addition";
echo "2:Substraction";
echo "3:Multiplication";
echo "4:Division";
echo "Enter The Choice:->";
read c
if ((c==1))
then
echo $((echo $no1 + $no2) |bc)
elif ((c==2))
then
echo $((echo $no1 - $no2) |bc)
elif ((c==3))
then
echo $((echo $no1 \* $no2) |bc)
elif ((c==4))
then
echo $((echo $no1 / $no2) |bc)
fi
To Create a Simple Maths Calculator Using Linux Shell Scripts
Reviewed by Unknown
on
07:07
Rating:
No comments: