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

Is double link list a linear data structure? If Yes, Why?If No, Why?

4 Answers  


how to find out the union of two character arrays?

2 Answers  


If you know then define #pragma?

0 Answers  


which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....

2 Answers  


what is difference between array and structure?

44 Answers   College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,






How do I swap bytes?

0 Answers  


What is the Lvalue and Rvalue?

2 Answers  


Explain the difference between #include "..." And #include <...> In c?

0 Answers  


What should be keep precautions while using the recursion method?

1 Answers  


21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

3 Answers  


Read two numbers from keyboard and find maximum of them?

1 Answers  


What does d mean?

0 Answers  


Categories