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 ..

#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 0 No

More C Interview Questions

Write a program to find the biggest number of three numbers in c?

Can we include one C program into another C program if yes how?

Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)

How can I find out how much free space is available on disk?

Are the outer parentheses in return statements really optional?

Which is best book for data structures in c?

How are pointers declared in c?

What is selection sort in c?

main() { struct test { char c; int i; char m; } t1; printf("%d %d\n", sizeof(t1), sizeof(t1.c)); }

why Language C is plateform dependent

#include<stdio.h> #include<conio.h> void main() { int m=0111,n=20; printf("%d%d\n",m,n); getch(); }

How many levels of indirection in pointers can you have in a single declaration?

Categories