c program to compute Income tax and Net Salary for its employees. The company offers tax relief of Kshs. 650 for single employees and Kshs. 1,100 for married employees. The relief will be deducted from the Gross salary, to give the taxable income. This will be computed at the following rates: [10mks]
Taxable Income Rate (%)
<5000 0
5000-19999 6
20000-36999 9
37000 and above 16



c program to compute Income tax and Net Salary for its employees. The company offers tax relief of ..

Answer / fa1thjp0

#include <stdio.h>

main ()
{
char employee_name, marital_status;
int employee_no;
float taxable_income, gross_income, tax, net_salary;

printf ("
Enter Employee Name:");
scanf ("%s", &employee_name);
printf ("
Enter Employee Number:");
scanf ("%d", &employee_no);
printf ("
Enter Employee marital status:");
scanf ("%s", &marital_status);
printf ("
Enter Employee Gross income:");
scanf ("%f", &gross_income);

if (marital_status == Married)
if (taxable_income < 5000)
tax = (gross_income - 1100) * 0.00;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 5000 && taxable_income < 19999)
tax = (taxable_income - 1100) * 0.06;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 20000 && taxable_income < 36999)
tax = (gross_income - 1100) * 0.09;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 37000)
tax = (taxable_income - 1100) * 0.16;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
else if (marital_status == NotMarried)
if (taxable_income < 5000)
tax = (gross_income - 650) * 0.00;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 5000 && taxable_income < 19999)
tax = (taxable_income - 650) * 0.06;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 20000 && taxable_income < 36999)
tax = (gross_income - 650) * 0.09;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
if (taxable_income >= 37000)
tax = (taxable_income - 650) * 0.16;
net_salary = taxable_income - tax;
printf("
Employee Net salary is %f:", & net_salary);
return 0;
}

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Ca some one please help me with aC code to allow user enter numbers from 1 to 20 without repeating and prnt the sum of those numbers thnx

4 Answers  


write a programme to convert temperature from farenheit to celcius?

4 Answers   IBM,


Explain b+ tree?

0 Answers  


what is the difference between c and java?

1 Answers  


pascal triangle program

2 Answers  






What is #include in c?

0 Answers  


what would be the output of the following program main() { int a[] = {1,2,3,4,5}; int *ptr = {a,a+1,a+2,a+3,a+4}; printf("%d %d %d %d",a,*ptr,**ptr,ptr); } }

1 Answers  


Can stdout be forced to print somewhere other than the screen?

0 Answers  


what is data structure.in linear and non linear data structures which one is better?Explain

3 Answers   Wipro,


What is unsigned int in c?

0 Answers  


Can we declare a function inside a function in c?

0 Answers  


What is calloc malloc realloc in c?

0 Answers  


Categories