Sunday 10 August 2014

Write an awk script to compute gross salary of an employee accordingly to rule given below. If basic salary is < 10000 then HRA=15% of basic & DA=45% of basic. If basic salary is >=10000 then HRA=20% of basic & DA=50% of basic.


BEGIN{
printf"enter the basic salary:Rs"
getline bp<"/dev/tty"
if(bp<10000)
{
hra=.15*bp
da=.45*bp
}
else
{
hra=.2*bp
da=.5*bp
}
gs=bp+hra+da
printf"gross salary=Rs.%.2f\n",gs

0 comments:

Post a Comment

 
- |