Write a program, which accepts annual basic salary of an employee and calculates and display the income tax as per the following rules. Basic: < 150000 Tax = 0 Basic: 150000 to 300000 Tax =20% Basic: >300000 Tax=30%
#include<stdio.h> void main() { float incometax=0,salary=0,totalsalary=0; printf("\n Enter the Basic Salary: "); scanf("%f",&salary); if(salary < 150000) { printf("\n IncomeTax : 0"); printf("\n Total Salary : %f",salary); } else if(salary > = 150000 || salary < =300000) { incometax=salary*0.2; totalsalary=salary+incometax; printf("\n Income tax 20% : %f",incometax); printf("\n Total Salary : %f",totalsalary); } else if(salary > 300000) { incometax=salary*0.3; totalsalary=salary+incometax; printf("\n Income tax 30% : %f",incometax); printf("\n Total Salary : %f",totalsalary); } getch(); }
Write a program, which accepts annual basic salary of an employee and calculates and display the income tax as per the following rules. Basic: < 150000 Tax = 0 Basic: 150000 to 300000 Tax =20% Basic: >300000 Tax=30%
Reviewed by
on
August 30, 2019
Rating: