source file name: Salaryfor.C

void main()

{

int e;

float bs;

float  da,hra,gs;

clrscr();

for(e=1;e<=3;e++)

{

printf("\n enter Basic Salary:");

scanf("%f",&bs);

da=bs*0.4;

hra=bs*0.2 ;

gs=bs+da+hra;

printf("\n Gross Salary: %f",gs);

}

getch();

}

output: