‘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
Post a Comment
Please do not enter any spam link in message.