Write a function that accepts a salary and returns the tax according to the following rules: No tax for first Rs.1000 , 5% tax for second Rs.1000 , 4% tax for third Rs.1000, 3% for remained untaxed salary
#include<iostream.h>
#include<conio.h>
int TAX(int sal);
void main()
{
clrscr();
int salary , tax;
cout<<"Enter salary: ";
cin>>salary;
tax = TAX(salary);
if(tax == 0)
cout<<"No Tax";
else
cout<<"The Tax is : "<<tax;
getch();
}
int TAX(int sal)
{
int tax;
if(sal > 3000)
return (5*1000)/100
}