Wednesday 29 November 2017

Tax Calculation Program

Write a program to calculate the income tax of an employee for the current financial year. A user will enter his age and Total salary of the current year and program will calculate and display the payable Income Tax from the given table. Tax slabs are applicable after deducting Rs. 1,00,000 of saving from total salary for each employee. The tax slabs are as
under: (Senior citizen: Age<60)

For All Tax
Rs.0 to 2,00,000 0% of income
2,00,001 - 5,00,000 10% on income excess of 2,00,000
5,00,001 - 10,00,000 30,000+20% on income excess of 5,00,000
Above Rs.10,00,000 1,30,000+30% on income excess of 10,00,000


For Senior Citizen Tax
Rs.0 to 2,50,000 0% of income
2,50,001 - 5,00,000 10% on income excess of 2,50,000
5,00,001 - 10,00,000 25,000+20% on income excess of 5,00,000
Above Rs.10,00,000 1,25,000+30% on income excess of 10,00,000

Solution :

#include<stdio.h>
#include<conio.h>
void main()
{
     int age;
     long salary,amount;
     clrscr();
     printf("Enter Age>> ");
     scanf("%d",&age);
     printf("Enter Salary>> ");
     scanf("%ld",&salary);
     if(age<60)
     {
          if(salary<200000)
              amount=0;
          else if(salary>200000 && salary<500000)
              amount=(salary-200000-100000)/100*10;
          else if(salary>500000 && salary<=1000000)
              amount=((salary-500000-100000)/100*20)+30000;
          else
              amount=((salary-1000000-100000)/100*30)+130000;

     }
     else
     {
          if(salary<250000)
              amount=0;
          else if(salary>250000 && salary<500000)
              amount=(salary-250000-100000)/100*10;
          else if(salary>500000 && salary<=1000000)
              amount=((salary-500000-100000)/100*20)+25000;
          else
              amount=((salary-1000000-100000)/100*30)+1250000;
     }
     printf("\n\tPayable amount is %ld",amount);
     getch();

}



No comments:

Post a Comment