‘C’ program, which accepts annual basic salary of an employee and calculates and displays the Income tax

C File =>


/* Write a ‘C’ program, which accepts annual basic salary of an employee and calculates and displays the Income tax as per the following rules. 
 Basic: < 1,50,000 Tax = 0 
 1,50,000 to 3,00,000 Tax = 20% 
 > 3,00,000 Tax = 30% */


#include<stdio.h>
int main() 
{
     int sal;
     float tax;
 
     printf("\n Enter basic salary : ");
     scanf("%d",&sal);
 
     if(sal<150000)
         printf("\n Income tax for given salary : 0 Rs.");
    else if(sal>150000 && sal<=300000)
   {
      tax=sal*0.2;
      printf("\n Income tax = %f",tax);
   }
    else if(sal>300000)
   {
       tax=sal*0.3;
       printf("\n Income tax = %f",tax);
   }
 
    return 0; 
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.