Q WAP to input monthly salary from the user and calculate the income tax according to the following rules:
#include<stdio.h>
#include<conio.h>
void main()
{float sal,tax;
printf("enter sal");
scanf("%f",&sal);
if (sal<7500)
tax=(sal*0.20);
else if (sal>=7500&&sal<9000)
tax=(sal-7499)*0.30+7499*0.20;
else if (sal>9000)
tax=(sal-8999)*0.40+1500*0.30+7499*0.20;
printf("total tax: %f",tax);
getch();
}
Salary income tax
>=9000 40% of the salary
7500-8999 30% of the salary
<7500 20% of the salary
#include<conio.h>
void main()
{float sal,tax;
printf("enter sal");
scanf("%f",&sal);
if (sal<7500)
tax=(sal*0.20);
else if (sal>=7500&&sal<9000)
tax=(sal-7499)*0.30+7499*0.20;
else if (sal>9000)
tax=(sal-8999)*0.40+1500*0.30+7499*0.20;
printf("total tax: %f",tax);
getch();
}
No comments:
Post a Comment