using namespace std;
float tax(long int s);
main()
{int salary;
float Tax;
cout<<"Enter Salary :";
cin>>salary;
Tax=tax(salary);
cout<<"Tax on salary is :"<<Tax;
}
float tax(long int s)
{float tax1;
if (s<=1000)
{
tax1=0.0;
cout<<"NO tax :";
}
else if(s>1000&&s<=2000)
{
s=s-1000.0;
tax1=5.0/100.0*1000;
}
else if(s>2000&&s<=3000)
{
tax1=5.0/100.0*1000.0;
s=s-2000.0;
tax1=tax1+(4.0/100.0*1000.0);
}
else
{
tax1=5.0/100.0*1000.0;
tax1=tax1+(4.0/100.0*1000);
s=s-3000;
tax1=tax1+(3.0/100.0*s);
}
return tax1;}