Thursday, May 1, 2008

Write a shell script to calculate gross salary of an employee.

echo “Basic salary”

read basic

expr ‘$da=$basic\*10/100’

expr ‘$hra=$basic\*20/100’

expr ‘$gross=$basic+$da+$hra’

echo “Gross salary = $gross”

1 comment:

Unknown said...

echo "enter limit"
read n
i=1
while [ $i -lt $n ]
do
sum=$((sum+i))
i=$((i+2))
done
echo "sum:"$sum