//Income tax is calculated on annual income according to following rules.
// salary married unmarried
//up to 100000 0% 0%
//100000... 300000 5% 10%
//above 300000 15% 20%
#include<stdio.h>
#include<conio.h>
{
float annual_salary,income_tax;
char marital_status;
printf("enter you marital status\n");
printf("married(m) and\n");
printf("unmarried(u)\n");
scanf(" %c",&marital_status);
printf("now enter you annual income ?\n");
scanf("%f",&annual_income);
if((marital_status=='m')||(marital_status=='u)' && annual_salary<=100000)
{
income_tax=0*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='m') && (annual_salary>100000 && annual_salary<=300000)
{
income_tax=0.05*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='m') && (annual_salary>300000))
{
income_tax=0.15*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='u') && (annual_salary>100000 && annual_salary<=300000)
{
income_tax=0.10*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='u') && (annual_salary>300000)
{
income_tax=0.2*annual_salary;
printf("tax amount=%f\n",income_tax);
}
getch();
}
// salary married unmarried
//up to 100000 0% 0%
//100000... 300000 5% 10%
//above 300000 15% 20%
#include<stdio.h>
#include<conio.h>
{
float annual_salary,income_tax;
char marital_status;
printf("enter you marital status\n");
printf("married(m) and\n");
printf("unmarried(u)\n");
scanf(" %c",&marital_status);
printf("now enter you annual income ?\n");
scanf("%f",&annual_income);
if((marital_status=='m')||(marital_status=='u)' && annual_salary<=100000)
{
income_tax=0*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='m') && (annual_salary>100000 && annual_salary<=300000)
{
income_tax=0.05*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='m') && (annual_salary>300000))
{
income_tax=0.15*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='u') && (annual_salary>100000 && annual_salary<=300000)
{
income_tax=0.10*annual_salary;
printf("tax amount=%f\n",income_tax);
}
elseif((marital_status=='u') && (annual_salary>300000)
{
income_tax=0.2*annual_salary;
printf("tax amount=%f\n",income_tax);
}
getch();
}